Div overwrite the Asp.net page

Source: Internet
Author: User
Page coverage during form submission
When submitting a form, the operator only needs to wait for the result to return. Here, I implemented a method to overwrite the webpage so that the entire webpage is overwritten by a large Div, in this way, the operator cannot click the content on the page. Implementation is simple, a div
<Div id = "doing" style = "Z-INDEX: 12000; left: 0px; width: 100%; cursor: Wait; position: absolute; top: 0px; Height: 100%; display: none ">
<Table width = "100%" Height = "100%">
<Tr align = "center" valign = "Middle">
<TD>
<Table width = "169" Height = "62" bgcolor = "#99 CCCC" style = "filter: alpha (opacity = 75); width: 169px; Height: 62px">
<Tr align = "center" valign = "Middle">
<TD> the page is being submitted. <br>
Loading. </TD>
</Tr>
</Table>
</TD>
</Tr>
</Table>
</Div>
The page is hidden when it is initially loaded and displayed when the submit button is pressed. After the result is returned, hide it again. JSPCode :
<%
String content = request. getparameter ("Tc ");
If (content = NULL ){
%>
<Form action = "#" method = "Post" onsubmit = "return show ()">
<Textarea name = "Tc"> dfdfsdf
Dfdaf </textarea>
<Input type = submit value = "go">
</Form>
<%
}
Else {
If (content. indexof ("/N") =-1)
Out. println ("Haha ");
// Content = content. replaceall ("/N", "<br> ");
%>
<Textarea> <% Out. println (content); %>
</Textarea>
<%
}
%>
Show method:
Function show (){
Document. getelementbyid ('doing'). style. Display =''
Return true;
}
When the form is submitted and the result is returned, the page is reloaded, and the display attribute of div is automatically set to none. Achieve the desired effect.
Div overwrite the Asp.net page

<Script language = "JavaScript">
Function fgoto ()
{
VaR W = Window. Screen. availwidth-100;

VaR H = self-service. Screen. availheight-200;

VaR doc=window.doc ument;

VaR DIV = Doc. createelement ("Div ");

VaR info = "<Table border = 1 style = width:" + W + "; Height:" + H + "; Background-color: red; filter: alpha (opacity = 30)> <tr> <TD align =/"center/"> <input type = button value = return onclick = javascript: document. getelementsbytagname ('body') [0]. removechild (showerr);> </TD> </tr> </table>"

Div. ID = 'showerr ';

Div. style. Position = 'absolute ';

Div. style. z_index = 100;

Div. style. width = 900;

Div. style. Left = 0;

Div. style. Top = 0;

Div. innerhtml = Info;

Doc. getelementsbytagname ("body") [0]. appendchild (DIV );

}
</SCRIPT>
<HTML>
<Body>

</Body>
</Html>

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.