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:
<input type= "button" onclick= "window.open". /adddpment ', ', ' height=180,width=550,fullscreen=no,resizable=yes,scrollbars=no,top=350,left=500 ') ' value= ' Add Department ' />
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:
<a href= "onclick=" window.open (' <%=url.action "," Admin ", Editdpment = Item. DEPARTMENT_ID})%> ', ', ' Width=530,height=200,location=no,menubar=no,status=no,scrollbars=no,resizable=no top= 300,left=500 ') > Department modifies </a><br/>
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:
<%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 ();