Showing posts with label scriptmanager. Show all posts
Showing posts with label scriptmanager. Show all posts

Wednesday, March 28, 2012

Multiple UpdatePanel on page Issue. Please Help

Cannot unregister UpdatePanel with ID XXX since it was not registered with the ScriptManager.This might occur if the UpdatePanel was removed from the control tree and latter added again

Help me guyz. i am getting this error, and i wonder y.

let me explain you my scenario

-

i have a wizard control and on its steps; i have dropped a script manager + 2 update panels. the update panels contain user controls (.ascx pages). the user controls are simple gridviews with some business logic binded to them.

when i start my applicaiton, the page opens, and a big error is displayed, as above.

kindly update me on this issue. wiating for your reply

Regards

- mbakhan

try pulling the script manager out of the wizard step, and put it at the top of the page (before all other controls but keep it inside the <form runat="server"> tag.).

Let me know if that helps.

-Alan


Hi Alan, thanks for the reply,

but still keep it coming, need help Urgent

well i have tried this. but it wont help.

my page has a master page on it, so my scriptmanager is just under the asp:content tag, it still wont help.

i will try to put it on the master page.


If putting it in the masterpage doesnot work, then post your code, because I have a similar situation on a page that works fine.

-Alan


well when i make the display of sidebar false of the wizard control, i get this error.

without that it seems to work fine.

any suggestions for this.

i will make a test page of this scenario and send it to you. where shuld i email you ?

- Bassam


I guess I need a clerification of what you have on your page. You have a wizard with 2 steps with an updatepanel in each step? And you have moved the update panel to the masterpage? Let me know if I got it wrong, because I am going to try and get my page to die the way your does :).

-Alan


Hi there

well i am getting the same error which you have discussed about, and i am not able to understand what / how to get a fix round of it. :(

my scenario is that i have a user control, UC1. i will drop it in an UpdatePanel UP1 on a wizard control WC1 step page, on the Main .aspx page. like

WC1 contains UP1; UP1 contains UC1,

Now the interesting part is that i use this wizard as a multipurpose navigation system; (Editing some values and i the wizard sidebar display enabled, second for adding some values where the sidebar display disabled.) . When the sidebar display is disabled, i get this error...otherwise it works fine. i have tried almost all the clues in the book..but nothing seems to wrk that well..or maybe i am not that near..:(...just help me in it.

i have the script manager declared rite under the form tag on the master page, and all seems good / smooth to me, but still I WILL GET THIS ERROR :(.

please help me over this error. Waiting for your reply. [I hope this completely explains my scenario]

- Bassam

Saturday, March 24, 2012

MyNamespace.MyWebService has no properties error helpp!

Hi all, i have been having trouble getting this to work: Im using masterpages, i set the web reference on the scriptmanager in the masterpage, and the scripreference on the content page, also have a modalpoup IN the content page, a link button in a gridview template and on the clik event (kind of) i call the jscript function to show the modal and execute the webservice(shown below)

HAve a Webservice, that doas a sql query to get certain values from a database:

1using System;2using System.Web;3using System.Collections;4using System.Web.Services;5using System.Web.Services.Protocols;6using System.Web.Script.Services;7using System;8using AjaxControlToolkit;9using System.Data;10using System.Data.SqlClient;11using System.Collections;12using System.Collections.Generic;13using System.Collections.Specialized;1415/// <summary>16/// Summary description for CargarDatos17/// </summary>18[WebService(Namespace ="http://tempuri.org/")]19[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]20[ScriptService]21public class CargarDatos : System.Web.Services.WebService {2223//public CargarDatos () {2425 // //Uncomment the following line if using designed components26 // //InitializeComponent();27 //}2829 [WebMethod()]30 [ScriptMethod()]31 public string GetDynamicContent(string ID_Cliente)32 {33 System.Data.SqlClient.SqlConnection Conn1 = new System.Data.SqlClient.SqlConnection("Data Source=DESKTOP;Initial Catalog=Encuestas;User ID=sa;Password=lf654");34 System.Data.SqlClient.SqlDataAdapter da1 = new System.Data.SqlClient.SqlDataAdapter("SELECT Nombre FROM Clientes WHERE ID_Cliente=@dotnet.itags.org.ID_Cliente", Conn1);35//System.Data.SqlClient.SqlCommand Cmnd = new System.Data.SqlClient.SqlCommand();36 //Cmnd.CommandText = "SELECT Nombre FROM Clientes WHERE ID_Cliente=@dotnet.itags.org.ID_Cliente";37 //Cmnd.Connection = Conn1;38 System.Data.DataSet ds = new System.Data.DataSet();39 try40 {41 da1.SelectCommand.Parameters.AddWithValue("@dotnet.itags.org.ID_Cliente",int.Parse(ID_Cliente));42 Conn1.Open();43 da1.SelectCommand.ExecuteNonQuery();44 da1.Fill(ds);45 Conn1.Close();46return ds.GetXml();47 }48catch (Exception ex)49 {50 Console.WriteLine(ex.Message);51return null;52 }53 }5455}

A Java script function that calls that web service (or at least try:P)

function ShowMyModalPopup(customerid){ var modal = $find('ModalPopupExtender1');

modal.show();

"http://tempuri.org/".CargarDatos.GetDynamicContent(customerid,DisplayResult);

 }

used to show a modalpopup and to pass on values to the web service, and if it works to call another jscript function to populate texboxes in the modalpopup panel.

Have 2 problems: im using firebug to debug client side, and its says to me: "http://tempuri.org/".CargarDatos has no properties...

i get this on the jsdebug:

var CargarDatos=function() {

2CargarDatos.initializeBase(this);

3this._timeout = 0;

4this._userContext = null;

5this._succeeded = null;

6this._failed = null;

7}

8CargarDatos.prototype={

9GetDynamicContent:function(ID_Cliente,succeededCallback, failedCallback, userContext) {

10returnthis._invoke(CargarDatos.get_path(),'GetDynamicContent',false,{ID_Cliente:ID_Cliente},succeededCallback,failedCallback,userContext);}}

11CargarDatos.registerClass('CargarDatos',Sys.Net.WebServiceProxy);

12CargarDatos._staticInstance = new CargarDatos();

13CargarDatos.set_path = function(value) {

14vare = Function._validateParams(arguments, [{name: 'path', type:String}]); if (e) throw e; CargarDatos._staticInstance._path = value; }

15CargarDatos.get_path = function() { return CargarDatos._staticInstance._path; }

16CargarDatos.set_timeout= function(value) { var e = Function._validateParams(arguments, [{name:'timeout', type: Number}]); if (e) throw e; if (value < 0) { throwError.argumentOutOfRange('value', value, Sys.Res.invalidTimeout); }

17CargarDatos._staticInstance._timeout = value; }

18CargarDatos.get_timeout = function() {

19return CargarDatos._staticInstance._timeout; }

20CargarDatos.set_defaultUserContext = function(value) {

21CargarDatos._staticInstance._userContext = value; }

22CargarDatos.get_defaultUserContext = function() {

23return CargarDatos._staticInstance._userContext; }

24CargarDatos.set_defaultSucceededCallback = function(value) {

25vare = Function._validateParams(arguments, [{name:'defaultSucceededCallback', type: Function}]); if (e) throw e;CargarDatos._staticInstance._succeeded = value; }

26CargarDatos.get_defaultSucceededCallback = function() {

27return CargarDatos._staticInstance._succeeded; }

28CargarDatos.set_defaultFailedCallback = function(value) {

29vare = Function._validateParams(arguments, [{name:'defaultFailedCallback', type: Function}]); if (e) throw e;CargarDatos._staticInstance._failed = value; }

30CargarDatos.get_defaultFailedCallback = function() {

31return CargarDatos._staticInstance._failed; }

32CargarDatos.set_path("/sovi1/CargarDatos.asmx");

33CargarDatos.GetDynamicContent=function(ID_Cliente,onSuccess,onFailed,userContext){CargarDatos._staticInstance.GetDynamicContent(ID_Cliente,onSuccess,onFailed,userContext);}

For the type of info there, i assume that it finds the web service, and i can see the method name there, so that should mean that im accesing the WS, but i still dont get why it fails, i never used jscript before neither web services, so its all new to me... so if anyone could point me in the right direction ill be more than gratefull.

Also, im having a Nullreference when i try to invoke the .show method from modalpopup, could this mean that im not finding the modalpopup control?

Plz i have been stuck at this point for over 4 days now.

Tnks in advance.


hi, you just need to drop the http://tempuri.org/" bit from the callback method name, so the method call would be CargarDatos.GetDynamicContent(customerid,DisplayResult);

Cheers Si


Tnks a millon man, it worked!! BUT for a reason... i previously had it that way, and i get the "web service not found error", this was while i was having both, the service reference and the script reference in a scriptmanagerproxy in a content page, i moved those references to a scriptmanager in the master page and then i was hable to find the web service (Mynamespace.mywebservice) but i was getting the above error. Now. i have all the references in the master page, and without the "MyNamespace" i got(U did actuallyStick out tongue) the web service to work.

So the web service issue its fixed, but im still having the modalpopup error, saying that has null on it, i also tryed using:

var modal=document.getElementById('<%=ModalPopupExtender1.ClientID%>');

and still no luck, the modal its on a content page inside a template field in a gridview, if someone can give me a clue on this than it′ll be a completely solved issue.

Tnks again for the rsponse dj Big Smile


No worries dude,

In respsone to your modalpopup problem

var modal=document.getElementById('<%=ModalPopupExtender1.ClientID%>');

This line will not work with the .show() method as it is trying to reference a DOM object not the modalpopup "Behavior" which controls a DOM element. It is the behavior that contains the .show() method. You were correct with this line
var modal = $find('ModalPopupExtender1');

But i'm guessing 'ModalPopupExtender1'is the wrong ID. I guessing if you use $find('<%=ModalPopupExtender1.ClientID%>') this might work, otherwise a quick and dirty way is to view source and look for a line like this(this is from the toolkit samples)

$create(AjaxControlToolkit.ModalPopupBehavior, {"BackgroundCssClass":"modalBackground","DropShadow":true,"PopupControlID":"ctl00_SampleContent_programmaticPopup","PopupDragHandleControlID":"ctl00_SampleContent_programmaticPopupDragHandle","dynamicServicePath":"/AJAX/AjaxControlToolkit/Samples/ModalPopup/ModalPopup.aspx","id":"programmaticModalPopupBehavior","repositionMode":2}, null, null, $get("ctl00_SampleContent_hiddenTargetControlForModalPopup"));

look for this property "id":"programmaticModalPopupBehavior" to find the ID you need to use in the $find() method, in this case it would be $find("programmaticModalPopupBehavior")

Cheers Si


Hi again... as before, u where right on that one too, i was hable to find the modalpopup using the behaviorIDBig Smile, and i need ur wisdom another time to finally get this thing to work, and also ill share a little revelation i had(im sounding like agent Smith...)anyway...im having a lot of trouble finding the textboxes to fill with my jscript function i tryed all this:

document.getElementById('ctl00_ContentPlaceHolder1_TxBxNombreCliente').value=xmlvalue;
document.getElementById('TxBxNombreCliente').value=xmlvalue;
document.getElementById('<%=ContentPlaceHolder1.TxBxNombreCliente.ClientID%>').value=xmlvalue;
document.getElementById('ContentPlaceHolder1.TxBxNombreCliente').value=xmlvalue;
$find('TxBxNombreCliente').value=xmlvalue;
$find('<%=TxBxNombreCliente.ClientID%>').value=xmlvalue;

and absolutely none worked (im trying to set a texbox value).

My revelation its the next... have a masterpage and a few contentpages the thing its that i needit to pass on some values from a content page to another, so i used the Server.Transfer("page2.aspx") on the source page, and virtual path and context.handler on the destination page, being in that one where i was invoking my javascript... and i realized that when y pass on from one webform to the other... the url didnt change so im seeing the content of page2... with the url of page1... so i moved the modalpopup panel to page 1... and was hable to get the thing to work using the

document.getElementById('ctl00_ContentPlaceHolder1_TxBxNombreCliente').value=xmlvalue;

VERY weird... but.. i dont want to use this solution... i want to be hable to find the textbox correcty (also tryed all the above options and none but this one worked)... im clueless by now... u have any idea to share?

Tnks again for the modalpopup thingBig Smile

Farewell

Leandro


HI all again... ill response myself on this matter, cause i was hable to find its solution.

After a lot(A LOT) of testing i manage to locate the control i was searching wothout using the $100_etc_etc_etcMyControl, how? i decided to stop using an external jscript file, and i embbeded the jscript whitin the content tags of the content page, then.. and ONLY then, i could find the textbox using the document.getElementById('<%=TxBxNombreCliente.ClientID%>').value=xmlvalue;

BUT i still cant do it from an external jscript file.... hope that this helps someone else with my same trouble.

Best regards and thns for all...See you all people soonStick out tongue


Farewell

Need documentation on ScriptManager.EnableScriptGlobalization

Hi,

Not that it doesn't exist, but I couldn't find any docs on the ScriptManager.EnableScriptGlobalization property.

Does anyone know what it's for? It's of Boolean data type.

-Andy

hello

it's used by the scriptmanager component so that it knows if it should include the atlasglob.axd handler on the page. this handler is responsible for introducing Sys.CultureInfo used by the locale methods of the client side of the platform (take a look at the atlas.js file to see what i mean).


I've just spent several hours trying to work out why my application was throwing a Javascript syntax error in IE. Setting EnableScriptGlobalization to false has rectified the problem but I'm damned if I know why! Will setting this property to false have any implications?

hello.

that's strange. any chance of getting a small simple page that reproduces this problem?

as i said in my previous mail, by default, atlas creates an object with all the info related to the en-us culture and injects it on the page. when you enable globalization, the scriptmanager inserts a script line on the page that points to a special handler. this handler tries to get the current culture and build a new globalization javascript object which is configured to that culture. to my knowledge, there are few methods that take this info into account. disabling globalization will not have a lot of negative effects: the onyl problem is that those locale methods will allwys use the en-US culture as the current culture and you might get wrong formatations due to that (though you might not even see this if you're not using any of these methods),.


I'm wondering if the error may be caused by my use of a custom HttpModule for handling errors. I'll try to knock up a simple page to replicate the error - I'm in the middle of a release so it may be a few days before i get a chance...

hello again.

oki...put it here when you have the time to build a simple page.

Wednesday, March 21, 2012

need help to start, Scriptmanager

Hello,

First time I try to include an atlas control.

I get an error "Extender controls require a ScriptManager to be present on the page."

Attempting to create cascading drop down lists, so here is the aspx code: (took cars sample and edited)

<atlasToolkit:CascadingDropDownID="CascadingDropDown1"

runat="server">

<atlasToolkit:CascadingDropDownProperties

TargetControlID="projectDDL"

Category="Project"

PromptText="Select a manufacturer"

ServiceMethod="populateProjectDDL"/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="wellDDL"

ParentControlID="projectDDL"

PromptText="Select a well"

ServiceMethod="populateWellDDL"

Category="Well"/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="sectionDDL"

ParentControlID="wellDDL"

PromptText="Select a section"

ServiceMethod="populateSectionDDL"

Category="Section"/>

</atlasToolkit:CascadingDropDown>

<asp:DropDownListID="projectDDL"runat="server"CssClass="label"Style="z-index: 105;

left: 281px; position: absolute; top: 92px"AutoPostBack="True"TabIndex="1">

</asp:DropDownList>

<asp:DropDownListID="wellDDL"runat="server"CssClass="label"Style="z-index: 106;

left: 281px; position: absolute; top: 154px"AutoPostBack="True"TabIndex="2">

</asp:DropDownList>

<asp:DropDownListID="sectionDDL"runat="server"CssClass="label"Style="z-index: 107;

left: 281px; position: absolute; top: 214px"TabIndex="3">

</asp:DropDownList>

In the code behind I have three populate subs that fetch data from sql db:

PrivateSub populateProjectDDL()

PrivateSub populateWellDDL()

PrivateSub populateSectionDDL()

Also had some*_SelectedIndexChanged subs, that used to do the job atlas is now going to do I suppose.

Back to the problem: scriptmanager?! What is that - where do I put it? Please help me get my first alas control going... Would be very nice..

A ScriptManager tag looks like:

<atlas:ScriptManager ID="ScriptManager1" runat="server" />

You may want toread more on Atlas itself to understand what one is and what it can do.


Yeah, sry, kinda rushed that question in,

didn't think this post would even be approved, delete, close, whatever... hehe

Thx for reply, sry about this post.