reverendleo
10-18-2005, 08:15 PM
Greetings!
I'm not sure why I'm having a hard time with this. I just want a simple message box to appear (with only 'OK' as a choice) when the page loads. Here are the first few lines of code under the Page_Load sub:
strMessage = "Please go to File --> Page Setup, and select 'Landscape' orientation before printing"
Dim strScript As String = "<script language=JavaScript>alert('" & strMessage & "');</script>"
If (Not Page.IsStartupScriptRegistered("clientScript")) Then
Page.RegisterStartupScript("clientScript", strScript)
End If
Questions: Is this coding right? If so, I'm wondering why I'm getting an error message saying "String constants must end with a double quote"
I feel really dumb, and am hoping someone can shed some light on my conundrum.
Thanks much.
I'm not sure why I'm having a hard time with this. I just want a simple message box to appear (with only 'OK' as a choice) when the page loads. Here are the first few lines of code under the Page_Load sub:
strMessage = "Please go to File --> Page Setup, and select 'Landscape' orientation before printing"
Dim strScript As String = "<script language=JavaScript>alert('" & strMessage & "');</script>"
If (Not Page.IsStartupScriptRegistered("clientScript")) Then
Page.RegisterStartupScript("clientScript", strScript)
End If
Questions: Is this coding right? If so, I'm wondering why I'm getting an error message saying "String constants must end with a double quote"
I feel really dumb, and am hoping someone can shed some light on my conundrum.
Thanks much.