ASP.net + jQuery + div mask

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.