I am working on asp.net web application. I have one UpdatePanel and there is table inside table which has data in some TextBoxes.
I have one save button too inside this UpdatePanel So I want to save this data into Database, when I click Save Button.
This is working fine till now.
But I want to show alert message to User that information saved successfully. I'm using javascript for this purpose, But Javascript is not working. so is this possible to achieve the desired functionality using javascript, if yes then please guide me Or if there is any other alternative method except this please let me know.
Thanks, Vivek
If you have update panel use ScriptManager.RegisterClientScriptBlock as below
ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Member Registered Sucessfully');", true)
Remember that you can't use Response.Write during an asynchronous postback.
It would be good if you have posted your code here.
Try This Line of Code Its Definitely work with Update panel.
var message = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize("Bill No. : " + BillNo + " successfully generated.");
var script = string.Format("alert({0});window.location ='ChhallanPrint.aspx';", message);
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", script, true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With