How to use the request string to pass the value to the ASPX page opened with the modal window.

Source: Internet
Author: User
Request | page | string
The modal window is a convenient way to extend the current page, but the ASPX file can only be invoked as an IFRAME of the HTM file. At the same time, the request string is also a convenient way to transfer the values between pages, so how to put the two together, that is, how to use the request string to pass the value to the modal window open aspx page?

We can use JS script to achieve this function:

1. Call 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. Code for the open HTM file (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" >
<table align= "left" cellpadding= "0" cellspacing= "0" width= "100%" height= "100%" id= "Table1" >
<tr>
&LT;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.