Recently I am working on an ASP project, and have encountered a nail in processing a lock like the original page, pop-up operation box or prompt box. Although the technology and code are both ready-made, however, I feel that there are few matches on the Internet, so I will post a blog record.
As follows:
650) this. width = 650; "border =" 0 "alt =" "src =" http://img1.51cto.com/attachment/201303/202558190.jpg "/>
Some code:
<Asp: ScriptManager ID = "ScriptManager1" runat = "server"> </asp: ScriptManager>
<Asp: UpdatePanel runat = "server" ID = "UpdatePanel1">
<ContentTemplate>
<Script type = "text/javascript" src = \' # \ '"/jquery. min. js"> </script>
<Script type = "text/javascript" src = \ '# \' "/jquery-ui.min.js"> </script>
<Script type = "text/javascript" src = \' # \ '"/jquery. blockUI. js"> </script>
<Script type = "text/javascript" src = \ '# \' "/chili-1.7.pack.js"> </script>
<Script type = "text/javascript">
$ (Document). ready (function (){
$ ('# Demo1'). click (function (){
$. BlockUI ({message: $ ('# loginForm ')});
$ ('# Button1'). click ($. unblockUI );
$ ('# Button2'). click ($. unblockUI );
$ ('# LoginForm'). parent (). appendTo (jQuery ("form: first "));
});
}); </Script>
<Asp: Button ID = "demo1" runat = "server" Text = "pop-up mask layer"/>
Note the following ):
1. Four js file paths must be written
2. # The Control ID is followed. If the page inherits the master, rewrite '# demo1' to' # <% = demo. clientID %> ', because after the client generates a page, it is afraid that the ID of the master and some controls inherited from the master will conflict, and the IDs of all controls will be generated again.
3. to trigger an event on the button server, you must add $ ('# loginForm '). parent (). appendTo (jQuery ("form: first"); this line of code ensures that the current mask layer belongs to the same form and master form.