How to use the request string to pass the value to the aspx page opened in the mode window

Source: Internet
Author: User
The mode window is a convenient way to expand the current page, but the aspx file can only be called as the IFRAME of the HTM file. At the same time, the request string is also a common method for transferring values between pages. How can we combine the two, that is, how to use the request string to pass the value to the aspx page opened in the mode window?
We can use JS scripts to implement this function:
1. Call the page code:
<Script language = "javascript">
Function GetCorrelativeItemId ()
{
Rdl = document. getElementsByName ("rdlSystem ");

Input = document. getElementById ("txtCorrelativeItem ");
Sysid = "";
For (I = 0; I <rdl. length; I ++)
{
If (rdl [I]. tagName = "INPUT ")
{
If (rdl [I]. checked)
{
Sysid = rdl [I]. value;
}
}
}

Arg = window. showModalDialog ("SearchItemC.htm? Sysid = "+ sysid, window," resizable: 1 ;");
If (arg! = Null)
{
Input. value = arg;
}}
</Script>
2.open the htmfile code (searchitemc.htm ):
<HTML>
<HEAD>
<Script language = "javascript">
Function ResolveUrl ()
{
Var frm = window. frames [0];
Frm. location = location. toString (). replace ("C.htm", "C. aspx ");
}
</Script>
</HEAD>
<BODY style = "margintop: 0; marginleft: 0; marginright: 0; marginbottom: 0" onload = "ResolveUrl ()">
<Table align = "left" cellpadding = "0" cellspacing = "0" width = "100%" height = "100%" ID = "Table1">
<Tr>
<Td valign = "top" width = "100%" height = "100%"> <iframe id = "ifmain" border = "0" width = "100%" height = "100%"> </iframe> </td>
</Tr>
</Table>
</BODY>
</HTML>
3. Aspx file (SearchItemC. aspx) Code:
Request. QueryString ["sysid"]. Trim ();

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.