01.using Microsoft.VisualBasic;
02.using System;
03.using System.Collections;
04.using System.Collections.Generic;
05.using System.Data;
06.using System.Diagnostics;
07.using System.Collections.Specialized;
08.using Microsoft.JScript;
09.namespace MCS
10.{
11. public partial class MyDialog : System.Web.UI.Page
12. {
13. protected string strParam = null;
14. private void Page_Load(System.Object sender, System.EventArgs e)
15. {
16.
17. }
18.
19. public string GetParam()
20. {
21. strParam = string.Empty;
22. int loop1 = 0;
23. int loop2 = 0;
24. string[] arr1 = null;
25. string[] arr2 = null;
26. NameValueCollection coll = null;
27.
28. //Load Form variables into NameValueCollection variable.
29. coll = Request.QueryString;
30. //Get Names of all keys into a string array.
31. arr1 = coll.AllKeys;
32. for (loop1 = 0; loop1 <= arr1.GetUpperBound(0); loop1++)
33. {
34. strParam = strParam + arr1[loop1] + "=";
35. // Get all values under this key.
36. arr2 = coll.GetValues(loop1);
37. for (loop2 = 0; loop2 <= arr2.GetUpperBound(0); loop2++)
38. {
39. if (Information.IsDate(arr2[loop2]))
40. arr2[loop2] = DateTime.Parse(arr2[loop2]).ToString("MM/dd/yyyy hh:mm:ss tt");
41.
42. strParam = strParam + arr2[loop2] + "&";
43. }
44. }
45.
46. if (strParam.Length > 0 && strParam.Contains("&"))
47. strParam = strParam.TrimEnd('&');
48. return strParam;
49. }
50.
51. public string GetPage()
52. {
53. return Request.QueryString["Page"];
54. }
55. }
56.}
01.<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyDialog.aspx.cs" Inherits="MCS.MyDialog" %>
02.
03.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
04.<html xmlns="http://www.w3.org/1999/xhtml">
05.<head runat="server">
06. <title>Dialog</title>
07. <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
08. <script type="text/javascript" language="javascript">
09. $(document).ready(function () {
10. var if_w = $("body").width();
11. var if_h = $(window).height();
12. $("<iframe width='" + if_w + "' height='" + if_h + "' id='Frame1'></iframe>").prependTo('body');
13. $("#Frame1").attr("src", "<%= GetPage() %>" + "?" + unescape("<%= GetParam() %>"));
14. });
15. </script>
16.</head>
17.<body>
18.</body>
19.</html>
至于为什么要放在iframe里面,而不直接使用load方法,是为了防止跳转时弹出一个新页面,而不是在本页面中跳转