[CSharp] View plaincopyprint?
Using Microsoft.VisualBasic;
Using System;
Using System.Collections;
Using System.Collections.Generic;
Using System.Data;
Using System.Diagnostics;
Using System.Collections.Specialized;
Using Microsoft.JScript;
Namespace MCS
{
public partial class MyDialog:System.Web.UI.Page
{
protected string strparam = null;
private void Page_Load (System.Object sender, System.EventArgs e)
{
}
public string GetParam ()
{
Strparam = string. Empty;
int LOOP1 = 0;
int loop2 = 0;
string[] arr1 = null;
string[] arr2 = null;
NameValueCollection coll = null;
Load Form variables into NameValueCollection variable.
coll = request.querystring;
Get Names of all keys into a string array.
arr1 = Coll. AllKeys;
for (LOOP1 = 0; Loop1 <= arr1. GetUpperBound (0); loop1++)
{
Strparam = Strparam + ARR1[LOOP1] + "=";
Get all values under the This key.
ARR2 = Coll. GetValues (LOOP1);
for (loop2 = 0; loop2 <= arr2. GetUpperBound (0); loop2++)
{
if (Information.isdate (ARR2[LOOP2]))
ARR2[LOOP2] = DateTime.Parse (Arr2[loop2]). ToString ("mm/dd/yyyy hh:mm:ss tt");
Strparam = Strparam + Arr2[loop2] + "&";
}
}
if (strparam.length > 0 && strparam.contains ("&"))
Strparam = Strparam.trimend (' & ');
return strparam;
}
public string GetPage ()
{
return request.querystring["page"];
}
}
}
The above GetPage method gets the page embedded in the IFRAME, the GetParam method is to get the parameters to be passed
Here is the front desk jquery page
[CSharp] View plaincopyprint?
<%@ page language= "C #" autoeventwireup= "true" codebehind= "MyDialog.aspx.cs" inherits= "MCS. Mydialog "%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title>Dialog</title>
<script src= "Scripts/jquery-1.4.1.min.js" type= "Text/javascript" ></script>
<script type= "Text/javascript" language= "JavaScript" >
$ (document). Ready (function () {
var if_w = $ ("Body"). width ();
var if_h = $ (window). Height ();
$ ("<iframe width=" + if_w + "' height= '" + if_h + "' id= ' Frame1 ' ></iframe>"). Prependto (' body ');
$ ("#Frame1"). attr ("src", "<%= getpage ()%>" + "?" + unescape ("<%= getparam ()%>"));
});
</script>
<body>
</body>
As to why it should be placed in an IFRAME, instead of using the Load method directly, to prevent a new page from popping up when jumping, instead of jumping on this page
Use jquery to dynamically create an IFRAME, embed pages, and pass parameters to an embedded page in a blank Web page