Click here to Skip to main content
15,904,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i m using below written code in javasript to give a message after successful insertion of data. but its not working properly, can any one plz explain whats the meaning of below code?

JavaScript
this.RegisterStartupScript("12", "<script>alert(' Record Inserted successfully')</script>");
Posted
Updated 6-Sep-13 0:55am
v2

Hi,

Try this.
Page.ClientScript.RegisterStartupScript(this.GetType(), "BackToStep1", "<script>alert(' Record Inserted successfully');</script>");


It will register your javascript event and after your event complete, it will execute this javascript event and will popup alert message.

Hope it helps.
 
Share this answer
 
v2
C#
Response.Write("<script type='text/javascript'>alert('" + AlerteMsg + "');</script>");


OR
JavaScript
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Msg", "<script type=\"text/javascript\"  language=\"javascript\">function showMsg(){return confirm(\"Message\");}</script>", true);


Try this.
 
Share this answer
 
v4
string script="alert('Record Inserted successfully')";
ClinetScript.RegisterclientScriptBlog(this.GetType(),"Successmsg",script);
 
Share this answer
 

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