Functional requirements: Disable the application by using the imagebutton control in the framework.ProgramAsk "Confirm Exit" and use JavaScript to Disable IE in The onclick event (C #) of imagebutton.
Problem proposal: When the dialog box is displayed, the content in the subinterface is lost. Even if you do not exit the system, you cannot return to the original status.
Solution: Do not directly use the imagebutton onclick event (C #), but use the attributes of imagebutton. add ("onclick", "javascript :... ") to solve this problem.
1. aspx file:
CopyCodeThe Code is as follows: <! -- Aspx file -->
<Asp: imagebutton id = "imagebutton_close" runat = "server" imageurl = "~ /Images/icons/stop.gif "/>
2. C # file:Copy codeThe Code is as follows: //. CS File
// Add events and run JavaScript code
Protected void page_load (Object sender, eventargs E)
{
If (! Ispostback)
{
Imagebutton_close.attributes.add ("onclick", "javascript: If (confirm ('try it, can it be successful? ') Return false ;");
}
}