DCRAPACCESS
asked on
Problem with RegisterStartupScript
Hi Experts
I use this code on many forms with out any problems:
Dim csname1 As [String] = "PopupScript"
Dim cstype As Type = Me.[GetType]()
Dim cs As ClientScriptManager = Page.ClientScript
If Session("LOG") <> "OK" Then
Session("LOG") = "ERROR"
If Not cs.IsStartupScriptRegister ed(cstype, csname1) Then
Dim cstext1 As New StringBuilder()
cstext1.Append("<script type=text/javascript> alert('Only members!') </")
cstext1.Append("script>")
cs.RegisterStartupScript(c stype, csname1, cstext1.ToString())
End If
Response.Redirect("Default .aspx?ID=1 ")
End If
I'm using master page.
My problem is that my alert never shows. But if i remove the Redirect, there is no problem?
I'm using the exact same code on many other pages without any problems? how can that be?
I use this code on many forms with out any problems:
Dim csname1 As [String] = "PopupScript"
Dim cstype As Type = Me.[GetType]()
Dim cs As ClientScriptManager = Page.ClientScript
If Session("LOG") <> "OK" Then
Session("LOG") = "ERROR"
If Not cs.IsStartupScriptRegister
Dim cstext1 As New StringBuilder()
cstext1.Append("<script type=text/javascript> alert('Only members!') </")
cstext1.Append("script>")
cs.RegisterStartupScript(c
End If
Response.Redirect("Default
End If
I'm using master page.
My problem is that my alert never shows. But if i remove the Redirect, there is no problem?
I'm using the exact same code on many other pages without any problems? how can that be?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
But you are 100% right about your comment about the rendering, that were the difference.
Thanks for your answer!