.Net 3.5, Ajax, Javascript APIs

I have created a simple form with which the user updates thier information to a SQL database. It runs with an update panel and as such is part of a partial page update. After a successful update to the data (using try catch, assuming not exception is thrown) it will update a label to "Sucessfully updated your profile". I don't want this to stay there; if they update again on the same page, there is no new indicator it was successful because the label is already set. I like mootools and scriptaculous APIs for javascript animations. I've done registration of scripts and what not to handle a client click event first, but is there any way to call a javascript function from within the .Net sub? I understand the disconnected state of the web, but I don't want the label to fade in and out unless the update was successful so simply binding it to the initial update button is not going to be helpful. Alternate solutions are welcomed as well, but I prefer to keep it clean using the APIs / frameworks mentioned.

thanks.

0
steel_city
9/9/2008 2:25:49 PM
asp.net.ajax-discussion 13973 articles. 1 followers. Follow

1 Replies
656 Views

Similar Articles

[PageSpeed] 0

Steel,

You can inject javascript into your page from the code-behind.  This is probably a solution you'll want to look at.  To inject javascript into your page after an async postback, you'll want to use the static RegisterStartupScript method of the ScriptManager class.  In your case, you should be able to inject a clientscript call to set the value of your label.  Here's the microsoft documentation for the method: http://msdn.microsoft.com/en-us/library/bb310408.aspx.

James


James Ashley, Magenic Technologies
(james.ashley.magenic@gmail.com)
0
vgiambattista
9/9/2008 3:35:36 PM
Reply: