Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI..
I need to show a message box in my site.. you people already provide some suggestions still i have prob.. i show my code here;

dim strSUCCESSmessage as string="success"
Page.RegisterStartupScript("OnClick", "<script>alert('" & strSUCCESSmessage & "');</script>") 



i got an error while run this code:

XML
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30648: String constants must end with a double quote.
Source Error:

Line 224:        'mySmtpClient.Send(myMessage)
Line 225:        SmtpMail.Send(myMessage)
Line 226:        Page.RegisterStartupScript("OnClick", "<script>alert('" & strSUCCESSmessage & "');</script>")
Line 227:        ' MsgBox(strSUCCESSmessage, MsgBoxStyle.Information, "Success")
Line 228:      '  dim strErrorDesc as string="Thanks for submitting your request.  We shall revert back to you."




give me the solutions for my prob..

regards
sasikumar
Posted
Updated 28-Oct-10 3:03am
v2
Comments
Sunasara Imdadhusen 28-Oct-10 9:03am    
Please use PRE tage
raju melveetilpurayil 28-Oct-10 9:04am    
[edit] edited for more readability[/edit]

Dim msg As String = "Hello!"
Response.Write(String.Format("<script type='text/javascript'>alert('{0}');</script>", msg))
 
Share this answer
 
Hi
Please use following:

VB
dim strSUCCESSmessage as string="success"
Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('"& strSUCCESSmessage &"');", true)



Please do let me know, if you have any doubt.
Please provide "Vote" if this would be helpful, and make "Accept Answer" if this would be correct answer.:rose:

Thanks,
Imdadhusen
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900