Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to show the message box after saving the data in db(sqlserver)
??
earlier i was using javascript alert like this

XML
public static void ShowMessage(string strMessage,Page pgno)
{
    Label lbl = new Label();
    lbl.Text = "<script type='text/javascript' language='javascript'>" + Environment.NewLine+ "window.alert('" + strMessage + "');</script>";
    pgno.Controls.Add(lbl);

}


but since putting update panel and asp:updateprogress Its not working.
Is there any ajax message box to use after saving the data.??
I know the "ConfirmButtonExtender"
but can we use it to show the confirmation message after saving the data into db(sqlserver)
Or better 1 .
And I dont want to use the message box earlier I was using the above one.

thanks in advance
Posted
Updated 31-Mar-10 23:00pm
v2

1 solution

Don't use Label to render you javascript, otherwise you will get the error message every time when your page gets post(Label retains the values as by default the EnableViewState is true for it).

When you are using update panel then only a part of the page gets refresh and if you want fire some javascript from the update panel in that case you need to register your script in the ScriptManager.

like this

ScriptManager.RegisterClientScriptBlock(....)


for more details on this go through this http://fredrik.nsquared2.com/ViewPost.aspx?PostId=430[^]
 
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