Showing posts with label function. Show all posts
Showing posts with label function. Show all posts

Wednesday, March 28, 2012

Page_Validator undefined Error??

Hi,

I have a jscript function calledEnableAll(). The following is the Function:-

function EnableAll()

{

alert("Hai");

EnableAllValidators(false);

EnableValidator('valreq_Salutation',true);

ShowError();

}

This i called on a button click. but only the alert message is pop_up. after that im getting this errorPage_Validators is undefined Jscript runtime error .

What was the solution for this??

How can i over come this...

Hi,

I'm not quite sure why you use this function. It seems you want to enable all validators on the page according to the name of the function.

The error is caused by an javascript exception, looks like it uses an object that doesn't exist internally. And I can't tell since I don't know your implementation in EnableAllValidators and EnableValidator function. You'd better use Visual Studio to debug your javascript to find out the reason and resolve it.

pageLoad javascript function not being called

for some reason the javascript pageLoad method is not being called

the javascript is in scirbble.js

the example i have followed informs me that the pageLoad method should be ran when the atlas script manager control has loaded.

Is this corret.

Could someone please point me in the right direction for getting the below code to work

Below is the javascript and aspx code

function pageLoad()
{
var surface = document.getElementById("drawingSurface");
image = surface.getElementsByTagName("IMG")[0];
originalSrc = image.src;

surface.attachEvent("onmousedown", startStroke);
surface.attachEvent("onmouseup", endStroke);
surface.attachEvent("onmouseout", endStroke);
surface.attachEvent("onmousemove", addPoints);
}

form id="form1" runat="server">
<Atlas:ScriptManager ID="AtlasScriptManager" runat="server" >
<Services>
<Atlas:ServiceReference Path="ScribbleService.asmx" />
</Services>
<Scripts>
<Atlas:ScriptReference Path="ScriptLibrary\Scribble.js" />
</Scripts>
</Atlas:ScriptManager>
<div id="drawingSurface"
style="border:solid 1px black;height:200px;width:200px">
<img alt="Scribble" src="http://pics.10026.com/?src=ScribbleImage.ashx"
style="height:200px;width:200px" />
</div>
</form>

i have the same problem since the last release. I had pageLoad() methods which were able to set elements on the initial loading which no longer fire automatically :?(

As a workaround, you can attach to thePageRequestManager events like so :

<script type="text/javascript"> Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoad);</script>

when i do the above mentioned work around i get an error

'Sys.WebForms.PageRequestManager' is null or not an object

i have tried adding the script above and below the sript manager html elements but it makes no diffrence.

below is the aspx page

any help would glady be appreciated.

<headrunat="server">

<title>Atlas Scribble Sample</title>

</

head><body><formid="form1"runat="server"><Atlas:ScriptManagerID="AtlasScriptManager"runat="server"EnablePartialRendering=true><Services><Atlas:ServiceReferencePath="ScribbleService.asmx"/></Services><Scripts><Atlas:ScriptReferencePath="ScriptLibrary\Scribble.js"/></Scripts></Atlas:ScriptManager><divid="drawingSurface"style="border:solid 1px black;height:200px;width:200px"><imgalt="Scribble"src="ScribbleImage.ashx"style="height:200px;width:200px"/></div><scripttype="text/javascript">

Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoad);

</script></form>

</

body>

</

html>
throw an alert into your pageLoad() function to see if it's getting called; my guess is that it is, at least nothing you've posted here would prevent it. The issue I see is that the element 'surface' isn't going to respond to the attachEvent function as you have it written, at least not in this framework. You could try to us $addHandler(surface,'onmousedown',startStroke); instead.

pageLoad() javascript function

I understand that a script with the pageLoad() function is a way to hook into the client side load event.

That works great if you are working in the .aspx page itself. What if you're in a user control and want something to hook into the pageLoad() event on the client?

I could use Page.RegisterClientScriptBlock() to inject the JS into the page, but that would overwrite any other function that might be in the master page, content page or other user controls.

Isn't there a way to just add an event to the page load on the client side and not worry about conflicting with other code?

Thanks,

John

Can you give an example of what you're trying to do?


I'm not sure I understand your problem, but if your user control inherits from Sys.UI.Control it's initialize method will be called when the page loads.

You can add your own pageLoad() handler by usingSys.Application.add_load().


HI,

I could use the page_load server event, but that would delay the rendering of the entire page until this process is complete. The effect I am looking for is to render a page so the user has something to look at. Then, when theclient on_load event fires, initiate some long running tasks that can take place while the user already has something to look at.

Thanks,

John


Sys.Application.Load is the client side event, not server side. Take a look at the documentation I linked. That's the event that pageLoad() calls implicitly.


Hi,

In the User control , write this function ,
<script>
function IAMIntheUserControl(object,eventArgs) {
}
</script>

register this script with RegisterClientScriptBlock.

Sys.Application.add_load( IAMIntheUserControl );

PageMethod Exception: "An entry with the same key already exists."

I am calling a PageMethod from a javascript function. This function is called from many different controls on a page. The problem occurs about the second time the method is called. An exception is thrown saying that an entry with the same key already exists. The weird thing is that everything continues to work normally from the users perspective. I would never have noticed this behaviour if I hadn't be debugging. Its more annoying than developement breaking, but I would still like a solution to it. Except I have no idea how to proceed. Am I just using PageMethod improperly?

I'm using ASP.NET 2.0 with C# code.

My config file says this about the assembly I'm using: System.Web.Extensions, Version=1.0.61025.0

Stack trace follows...

EXCEPTION:

{"Error executing child request for /thesite/problemLog.aspx."}

STACK: atSystem.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler,TextWriter writer, Boolean preserveForm, Boolean setPreviousPage,VirtualPath path, VirtualPath filePath, String physPath, Exceptionerror, String queryStringOverride)
at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm)
at System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm)
at System.Web.HttpServerUtility.Transfer(String path)
at ASP.global_asax.Application_Error(Object sender, EventArgs e) in c:\Projects\Velocity Code\cfdrodeo\Global.asax:line 92
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.HttpApplication.RaiseOnError()

INNER EXCEPTION:

{"Exception of type 'System.Web.HttpUnhandledException' was thrown."}

STACK:

at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.problemlog_aspx.ProcessRequest(HttpContext context) inc:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NETFiles\cfdrodeo\0b93ea50\5991e932\App_Web_xczsyy3k.22.cs:line 0
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandlerhandler, TextWriter writer, Boolean preserveForm, BooleansetPreviousPage, VirtualPath path, VirtualPath filePath, StringphysPath, Exception error, String queryStringOverride)

INNER EXCEPTION:

{"An entry with the same key already exists."}

STACK:

at System.Collections.Specialized.ListDictionary.Add(Object key, Object value)
at System.Web.UI.ClientScriptManager.RegisterScriptBlock(ScriptKey key, String script, ListDictionary& scriptBlocks, ArrayList& scriptList, Boolean needsScriptTags, Boolean& inScriptBlock)
at System.Web.UI.ClientScriptManager.RegisterScriptBlock(ScriptKey key, String script, ClientAPIRegisterType type)
at System.Web.UI.ClientScriptManager.RegisterClientScriptInclude(Type type, String key, String url)
at System.Web.UI.ScriptRegistrationManager.RegisterClientScriptInclude(Control control, Type type, String key, String url)
at System.Web.UI.ScriptManager.RegisterClientScriptInclude(Control control, Type type, String key, String url)
at System.Web.UI.ScriptManager.RegisterClientScriptIncludeInternal(Control control, Type type, String key, String url)
at System.Web.UI.ScriptManager.RegisterScripts()
at System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e)
at System.Web.UI.Page.OnPreRenderComplete(EventArgs e)
at System.Web.UI.Page.PerformPreRenderComplete()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Thank you for your help.

Hi,

could you post the code of your page method and the JavaScript code that you use to invoke it?

PageMethods and Exceptions

Hi,
i was looking for information about how to manage Exception throwed by page methods.
I mean, is there any way in the javascript function that is called on failure of the page method to know the type of the exception throwed?
I know that the object passed as parameter to this function has the get_message() method to get the exception's message, but i can't find any other information about it.

sorry for my poor english and thanks for your answers,

bye

Well, frankly your best option is to not throw them. Either handle them inside the page method or else have some kind of catchall error handler for the page / app (or both). In terms of debugging, you can then (in the catch block) log on the server any info you might want to, and not worry about whether the javascript object will support inspection of the core problem or not.


Say you call a page method like this:
function UpdateTime()
{
PageMethods.GetCurrentDate(OnSucceeded, OnFailed);
}
function OnSucceeded(result, userContext, methodName)
{
$get('Label1').innerHTML = result;
}
function OnFailed(error, userContext, methodName)
{
$get('Label1').innerHTML = "An error occured.";
}

OnFailed will be called anytime there's an exception thrown from the web method. "error" contains several useful properties, such as error._exceptionType, error._message, and error_stackTrace.


FYI the Exception Type, StackTrace etc is not the server side objects, instead it is the client info.


gt1329a:

"error" contains several useful properties, such aserror._exceptionType, error._message, and error_stackTrace.

thank you, this is what i was looking for!

but before i mark this thread as "resolved" there's another question a want to ask you:

where did u find those information? 'cause i look for them for pretty long time but i culdn't find anything but the get_message() method.


Checkouthttp://www.asp.net/ajax/documentation/live/ClientReference/Global/JavascriptTypeExtensions/ErrorTypeExt/default.aspx andhttp://msdn2.microsoft.com/en-us/library/b8664205-d28e-4cde-bd76-69173ff72dea.aspx


thanks a lot to all of you


YaWW:

where did u find those information? 'cause i look for them for pretty long time but i culdn't find anything but the get_message() method.

I find it easier toexplore the DOM with a JavaScript debugger, than to read the docs. That's how I found the exception information. I set a breakpoint on the client side error handler and then looked at what information was returned.

PageMethods

Hi Folks

I'm getting an error with AJAX Beta1 trying to access PageMethods...

function beginImport() { disableButton('btnSubmit'); displayProgress(); updateText('Importing Translations, please wait for process to complete before clicking anything!'); PageMethods.Import(onImportComplete); }

Causes this error...

Error: PageMethods is undefined

Are you defining the onImportComplete function in Jscript?

I have the same problem. I keep getting "PageMethods is not defined" error. Here's my code:

<%@. Page Language="C#" AutoEventWireup="true" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title>Untitled</title><script runat="server"> [System.Web.Services.WebMethod] public string GetMessage() { return "Hello World"; }</script></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <a href="#" onclick="javascript:preview();">Test</a> <script type="text/javascript" language="javascript"> function preview() { PageMethods.GetMessage(onComplete); } function onComplete(res) { alert(res); } </script> </form></body></html>

Shawn Burke talks about PageMethods and Ajax Beta in hisblog

It seems that they need to be static and marked with the ScriptMethod attribute. But if PageMethods are static how do we access page control values within such a method?


I am completely stuck on the pagemethods, and having the same problem. I have read the blog and added the [ScriptMethod] tag to the page method (this tag is not in Microsoft's pagemethod tutorial (here), but I am willing to try anything at this point). I have used the default web.config file that is created when you use the ASP.NET AJAX CTP - Enabled Website template in VS2005, and verified that all of the settings are present as outlined in the migration white paper and the webservice tutorial on ajax.asp.net.

I need to be able to call a pagemethod because i need access to the viewstate and server control properties on the page. A webservice would not give these to me.

All of this worked fine in the July CTP... here is my code:

[C#]

[WebMethod]
[Microsoft.Web.Script.Services.ScriptMethod]
publicstatic GeneralLiability.GeneralLiabilityQuote GetQuote()
{
returnnew GeneralLiability.GeneralLiabilityQuote(10);
}

[JS]

Rate:function()
{
this.showLoadingPanel();
this._MustRefresh.set_visible(false);
// should be page method
PageMethods.GetQuote(this.onGetQuoteComplete, this.onGetQuoteTimeOut);
},

[ScriptManager]

<asp:ScriptManagerID="ScriptManager1"ScriptMode="Debug"runat="server">
<Scripts>
<asp:ScriptReferenceAssembly="Microsoft.Web.Preview"Name="Microsoft.Web.Resources.ScriptLibrary.PreviewScript.js"/>
<asp:ScriptReferenceAssembly="Microsoft.Web.Preview"Name="Microsoft.Web.Resources.ScriptLibrary.PreviewGlitz.js"/>
<asp:ScriptReferenceAssembly="Microsoft.Web.Preview"Name="Microsoft.Web.Resources.ScriptLibrary.PreviewDragDrop.js"/>
</Scripts>
<Services>
// ths webservice is a work around until i get the PageMethod working
<asp:ServiceReferencePath="~/WebServices/RateWebService.asmx"/>
</Services>
</asp:ScriptManager>


Spent alittle more time looking at the PageMethods issue.

I wrote a small test app and realized that the PageMethods object exists when the webmethod is included in the aspx file (as long as I added the
[Microsoft.Web.Script.Services.ScriptMethod]) attribute, but when I move it to the code-behind file, it gives me the undefined error... which leads me to question... are pagemethods no longer allowed in the code-behind file?

Anyone?


See:http://blogs.msdn.com/sburke/archive/2006/10/21/hint-components-that-use-web-services-with-asp-net-ajax-v1-0-beta.aspx. PageMethods are broken in Beta1 and do not work in code behind.

Dimitrod, you say: "But if PageMethods are static how do we access page control values within such a method?".
I may be wrong, but IMO it does not make sense to access controls in PageMethods. PageMethods are part of the business layer. You should read control values using client-side code, pass these values to the method as parameters and read the returned data in the form of a basic type or a complex serialized object. I personally think it is a good thing that PageMethods are now static.


In the Atlas July CTP, Im using the Page.User.Identity.Name as a security verification inside the PageMethods , How would I do this in the new version without passing parameters in javascript, as this would reveal the values.

>> I may be wrong, but IMO it does not make sense to access controls in PageMethods. PageMethods are part of the business layer.

Yes and no. But the point is you can already achieve teh 'business layer' effect by calling a Web Service and now with PageMethods being forced to be static you're doing nothing but duplicating that functionality. All this does give you another place to store your 'service methods'.

Allowing access to the page is very valuable IMHO because it allows you to read values set on the client without having to pass every damn field value as a parameter or as part of an object you first populate on the client.

Consider this: You have a form with 50 input fields on it and the user fills that out. Now you want to use AJAX to save those values. If you use PageMethods or Web Service you have to pass 50 parameters or create a client object that first parses the values out of the fields, possibly converts to the proper types etc. Then you send the data to the server, and you get the parse the values AGAIN on the server - out of the parameters or object into a business object or a DataRow or whatever.

Instead not passing parameters but receiving the values from the client directly on the server in the POST buffer lets you deal with the input values once and store it directly into your object.

I can be a huge timesaver and reduces boatloads of error prone $get() statements on the client.

If all that PageMethods does is duplicate Web/SCript Service behavior but in a page I say cut the whole thing and take the overhead out of the Page class.


Page.User is merely a convenience property that wrapsSystem.Threading.Thread.CurrentPrincipal, which is static, so just access that instead :)


Rick,

Convincing point of view, although a form with 50 input fields seems theoretical to me because it is not very user friendly. I should not have said "it does not makes sense" but I still do not like it.

Despite the fact that you definitely have a point, I prefer the more stateless approach of parsing the fields on the client and feeding a Javascript object that is passed to the web service or page method as you describe. Contrary to what you say, it is not needed to parse the object again on the server, the ASP.NET Ajax layer does that automatically for you, although you may have to write a couple of converters. Note that my business objects are very light data structures which are effectively persisted by business brokers.

By the way, thank you for your valuable web site, which I often consult.


I agree as well - in most cases I use Web Services to abstract the logic, because it's just cleaner. But I would very much like to have the option to be able to get at the data in an easier way in the page.

As to the form with 50 fields: Well there's lots of ways to represent data <s>. Yeah you're probably right but I have a couple of forms that have this much data in various pages of a tabbed interface that's driven through AJAX. In fact in a properly architected AJAX application values are probably updated more frequently than one giant form submit.

But even so even if you have a smallish form like this:

http://www.west-wind.com/atlas/CustomerList/AtlasCustomerList.aspx

You then have code like this to retrieve the data to send to the server:

// *** Cheating: This object contains only strings!
// If other types exist conversion
// must be done here.
Customer.Companyname = GetValue('txtCompany');
Customer.Contactname = GetValue('txtContactName');
Customer.Address = GetValue('txtAddress');
Customer.City = GetValue('txtCity');
Customer.Postalcode = GetValue('txtPostalCode');
Customer.Region = GetValue('txtRegion');
Customer.Country = GetValue('txtCountry');

// *** Pass back the customer object to the server
CustomerService.SaveCustomer(Customer,SaveCustomerCallback,ErrorCallback,ErrorCallback);

It gets worse if the object your setting values on has typed values - then you have to do type conversion in JavaScript which is no fun... Then on the server you do that parsing again out of the object so you're just duplicating the work.

When I meant 'parsing on the server' I didn't mean parse the object. You do get the object back on teh server. But it's a proxy at best and from there you have to move the data out into a real object that actually does the data logic - an Entity that can save or a DataRow or whatever it may be. For most types a type converter isn't even required as the JSON proxy creates the required proxy objects on the client for you. That is very cool, but it's still more work than it has to be - you're still 'reading' the data twice - once on the client, then again on the server. Instead you could do it once and be done with it.


As something of an ASP.NET AJAX Novice I find this thread very interesting.

For me it touches a wider issue which is that for the newbie there is a vast array of possible approaches to building an ASP.NET AJAX app and the best path is not always clear.

My very first app simply used an UpdatePanel and seemed to work fine but then I decided I wanted a bit more control over what was happening.

Consequently my next app used PageMethods to call functions in the ASP.NET Codebehind. Again this seemed to work fine for such things as retrieving Strings etc.

Then I looked at Web Services and devised a couple of those which I then referenced from my ASPX pages (using the ScriptManager)

Now though I'm not really very clear where to go next.

I guess it's like anything else, you just need to give it time and try lots of different things before you can make a judgement call on the best way forward. The danger is that for those of us who have never used much javascript, we may be tempted to try and avoid it (using the UpdatePanels etc) but then come unstuck when we want a bit more control over our app's behaviour.

I hope the documentation will help with this though once the framework goes RTM.


I think ScriptMethods (PageMethods) are part of the UI layer; consider where they are declared - no business logic should be residing in the Page class. I hope they change it so that they'll go back to being state-aware and part of the Page lifecycle again. The way it's implemented in the new beta, there's really not much distinction between a ScriptMethod and a WebMethod (web service) any more.

insted of breaking ypur head and program again and again

it is better to wait to next version or final version

i will stick in july ctp until a better version will come

my program need page.clientscript.registerStartupscript and PageMethod

and both of them not working in ajax beta 1

so why go ther from july ctp?

PageMethods CallBack Wont Fire

What conditions will cause the callback function to not fire when using the PageMethods class?

First my javascript:

<scripttype="text/javascript"language="JavaScript">

function FindTheResult()

{

var txt = document.getElementById("ctl00_contentPlaceHolder_txtBib").value;

PageMethods.FindResultMethod(txt, FindResultDone);

window.status = txt;

returnfalse;

}

function FindResultDone(arg)

{

window.alert(arg);

}

</script>

and then my codebehind:

[WebMethod]

public string FindResultMethod(string bib)

{

return "Hello";

}

FindResults() is firing because my status bar gets updated. But the FindResultDone function is not firing.

A client script error in javascript may have happened in this line:

PageMethods.FindResultMethod(txt, FindResultDone);

In this line, FindResultDone() is expecting a parameter but was not supplied


Ok, that makes FindResultDone actually fire. But how do utilize the return string from my WebMethod:public string FindResultMethod(string bib) ?

Leaving out the ( ) and any paramaters usually just passes the return string back to the callback method. See this atlas.asp.nettutorial code. The callback has no parameters, yet the function does.

This all worked flawlessly with the October release.

AlvinVi wrote:

A client script error in javascript may have happened in this line:

PageMethods.FindResultMethod(txt, FindResultDone);

In this line, FindResultDone() is expecting a parameter but was not supplied


Hi,

mxmissile wrote:


PageMethods.FindResultMethod(txt, FindResultDone);

This statement is correct, you don't need to add the () or any parameters because you have to pass a reference to the method (callback) that will be called when the server method returns.

I've tried your code (that seemed correct to me) on a machine and in fact everything went ok: the callback is fired and the string is displayed.

But then I've tried it on another machine and I got the strange behavior that you reported: the callback isn't fired because the asynchronous request returns a response with status code 500 (Internal Server Error). You could try to make the following call:

PageMethods.FindResultMethod(txt, FindResultDone, FindResultTimeout, FindResultError);

and then add these two functions:

function FindResultTimeout() {
alert('timeout');
}
function FindResultError(result, response) {
alert(response.get_statusCode());
}

Try to run the code and see what happens: probably the FindResultError callback will be fired.

Now, I suppose that you have added an <atlas:ScriptManager> tag in your page. Try to add a reference to a web service (for example, create a simple WebService.asmx)

<atlas:ScriptManager id="scriptManager" runat="server">
<Services>
<atlas:ServiceReference Path="WebService.asmx" />
</Services>
</atlas:ScriptManager>

and the run the code: which callback is fired now? In my case, the FindResultDone callback is fired and the response error disappeared...

I think it's a strange behavior.. I'll try to understand what is happening, but has anyone got ideas on what is going on?

Ok, ill try adding the webmethod to a seperate asmx file to see what happens.

I also have some other data:

function FindResultError(result, response) {
alert(response.get_statusCode());
}

When I do this, the alert window just says "null", so the error function is being called at least I think.

My page is using a Master Page, when I move the code to a "un-master page"ed" aspx file it works great.

I started a new test atlas project and everything is working great, until I start using Master Pages. It fails if I put the <atlas:ScriptManager tag is in the <head> of the Master Page or in the content section.

Anyway thanx for the input, still hacking at it...


Hi,

mxmissile wrote:


My page is using a Master Page, when I move the code to a "un-master page"ed" aspx file it works great.


You mean the first code you posted? I've tried it without a master page and it's working on a machine, but failing on another.

mxmissile wrote:


Ok, ill try adding the webmethod to a seperate asmx file to see what happens.


Just create a new web service (WebService.asmx), reference it in the<atlas:ScriptManager> tag but continue to call the method definedin your page (PageMethods.FindResultMethod). In my case this solved theproblem but it's a strange behavior.

Wednesday, March 21, 2012

Parameters... :(

Hi,

I have a menu with divs (items)...and I want to make one function to handle all menu items..

I have the following code:

var sCurrentPage = "";

<font size=2></font></p><p><font color=#0000ff size=2>function</font><font size=2> MouseClick(sender)
{
</font><font color=#0000ff size=2> if</font><font size=2> ($(sCurrentPage))
$(sCurrentPage).style.backgroundColor = </font><font color=#800000 size=2>"#FFFFFF"</font><font size=2>;
</font><font size=2>
sCurrentPage = sender.get_id();
$(sCurrentPage).style.backgroundColor = <font color=#800000 size=2>"#BBBBFF"</font><font size=2>;
</font></font><font size=2>}</font></p><p><font size=2></font>...</p><p>//my atlas script</p><font size=2><p><label id=</p></font><font color=#800000 size=2>"MenuItemNutriente"</font><font size=2>>
</font><font size=2><behaviors>
<clickBehavior </font><font size=2>click=</font><font color=#800000 size=2>"MouseClick"</font><font size=2> />
</behaviors>
</label><p></p></font>

The "sender" parameter is allways the clickBehavior object. How can I get the Label object that are firing the event?

thanx :)

I'm having trouble parsing all the HTML formatting above - does this question involve the Atlas Control Toolkit?

Partial rendering doesnt update the javascript...

Hello all,

I am using an UpdatePanel where I have used a server side public variable in javascript function like,

<

scriptid="Infragistics"type="text/javascript">

var myValue = "<%=ServerVariable%>";

</script>

First time, when the page is fetched, myValue contains a value. After the asynch Postback the ServerVariable changes on server side, but the javascript is not updated after partial rendering and myValue contains the previously rendered value. Is there any way to refresh the script block again after every partial rendering?

Thanks in Advance.

Mudassar Majeed

Instead of puttong the script tags, please generate the script in a string and use ScriptManager.RegisterClientScriptBlock function to register the script.
Thanks alot, it worked fine.