vivek jain vivek jain - 1 year ago 133
ASP.NET (C#) Question

Javascript alert is not working in Update Panel in

I am working on 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.


Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download