MVC, 3 Windows pop-up settings method

Source: Internet
Author: User
Want to do the page beautification, especially in a page, only take up a very small piece of the page, want to make pop-up window style, a little summed up under:

1, through the Rewrite, <input tab button under the OnClick event, to the window pop-up settings:

Copy Code code as follows:


&lt;input type= "button" onclick= "window.open". /adddpment ', ', ' height=180,width=550,fullscreen=no,resizable=yes,scrollbars=no,top=350,left=500 ') ' value= ' Add Department ' /&gt;


Among them, window.open (' Path ', ' width of the window, height, relative to the position of the form, whether the full screen, whether there are sliding and other property settings ', ', ');
2, by rewriting <a herf= ' "To get the window:

Copy Code code as follows:


&lt;a href= "onclick=" window.open (' &lt;%=url.action "," Admin ", Editdpment = Item. DEPARTMENT_ID})%&gt; ', ', ' Width=530,height=200,location=no,menubar=no,status=no,scrollbars=no,resizable=no top= 300,left=500 ') &gt; Department modifies &lt;/a&gt;&lt;br/&gt;


which Because of the path reason in MVC, it is recommended that you use <%=url.action> to set its path, where you can pass parameters by creating New{id} in Url.action.
3, can be defined through jquery, and in the control call
After a pop-up window, you can return to the frame window by redefining the form's address and target property, for example:

Copy Code code as follows:


&lt;%using (Html.BeginForm ("Editgroup", "Admin", FormMethod.Post, new {target = "mainFrame"}))


This is done by rewriting the BeginForm, which is the same as the normal <form form submission after parsing.
If you want to close a small window after submitting a form, you can control it by using the OnClick event in the <input, Javascript::self.close (), or window.close ();

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.