RegisterStartupScript while using AJAX Update Panel

If the update panel is used in the page then there must be a problem while using the RegisterStartupScript in code behind. In this case we don't need the "
ClientScript.RegisterStartupScript(Me.GetType, "msgstr", Msg1)


RegisterStartupScript in code behind(Update Panel is used)

		
Dim Msg2 As String
Msg2 = "alert('Welcome')"
ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), Msg2, True)


Comments

Author: Sabarees04 Jul 2008 Member Level: Gold   Points : 1

hi Vanitha,

Really it's a good one. your code was helped me exactly. thank you for posting this.

Regards
Sabarees

Author: Lion13 Nov 2009 Member Level: Gold   Points : 2

Hi friends It is really good.
but 1 problem is occured. when this script use in try -Cath block
it is not working..

for ex.


try
{


}
catch(exception ex)

{

ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), alert('"+ex.message.Tosting()+"'), True)


}