RegisterStartupScript updated way to right Java script JS (Javascript) in code behind also work with update panel
Dear All
RegisterStartupScript is obsolete now the new way that works with update panel is given below its is code behind file code also
Dim csname1 As String = "PopupScript"
Dim cstype As Type = Me.GetType()
Dim cs As ClientScriptManager = Page.ClientScript
Dim cstext1 As String = "alert('Your message');"
cs.RegisterStartupScript(cstype, csname1, cstext1, True)
String csname1 = "PopupScript";
Type cstype = this.GetType();
ClientScriptManager cs = Page.ClientScript;
String cstext1 = "alert('Hello World');"; cs.RegisterStartupScript(cstype, csname1, cstext1, true);
RegisterStartupScript is obsolete now the new way that works with update panel is given below its is code behind file code also
VB Code
Dim csname1 As String = "PopupScript"Dim cstype As Type = Me.GetType()
Dim cs As ClientScriptManager = Page.ClientScript
Dim cstext1 As String = "alert('Your message');"
cs.RegisterStartupScript(cstype, csname1, cstext1, True)
C# Code
String csname1 = "PopupScript";
Type cstype = this.GetType();
ClientScriptManager cs = Page.ClientScript;
String cstext1 = "alert('Hello World');"; cs.RegisterStartupScript(cstype, csname1, cstext1, true);
I hope it will help you also
Regards
Rashid Imran Bilgrami
Comments
Post a Comment
Thanks for the Comments , Your review will display soon