In your code behind the file, you can add the following function
private void ShowMessage(string msg){
string myScript = "\n<script type=\"text/javascript\">\n";
myScript += "alert(" + msg + ");";
myScript += "\n\n </script>";
Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", myScript, true);
}
call the function above, wherever you want to show a warning with your custom message.
Add the code below on the client side, which means on the designer page in the tag
$(document).ready(function() {
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
});
function EndRequestHandler(sender, args) {
}
source
share