Wednesday, March 21, 2012

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.

No comments:

Post a Comment