1, remove language= ' javascript ', the problem is still
2, after adding Response.Write ("<script>document.location=document.location;</script>"); This sentence, tried, found that the style is unchanged, but the page is loaded from the new, ViewState was emptied (this can not, the user changes have not been saved yet)
3, this. RegisterStartupScript ("", "<script language=javascript>alert (' Please save your edits first! ') </script> ");
instead of you.
Response.Write ("<script language= ' JavaScript ' >alert (' please save your edits first! ');</script> ");
The best way:
Using RegisterStartupScript is to output the script to the client, which is better than Response.Write to enter the script at the bottom of the page without affecting the style, but sometimes VS2005 prompts for a long warning, and the workaround is written as:
Clientscript.registerstartupscript (this. GetType (), "", "<script language=javascript>alert (' Please save the changes first! ') </script> ");
Page aliasing after ASP. NET Popup Box