<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default"  %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /><br />
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtName" runat="server" ></asp:TextBox>
        <asp:TextBox ID="txtPwd" runat="server"></asp:TextBox>
        <asp:TextBox ID="txts" runat="server"></asp:TextBox>
        <br />
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br />
    </div>
    </form>
    <%=formStr %></body>
</html>
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;public partial class _Default : System.Web.UI.Page 
{
    protected string formStr;    protected void Page_PreInit(object sender, EventArgs e)
    {
        if (Request.Form["s"] != null)
        {
            Page.Theme = Request.Form["s"].ToString();
        }
    }    protected void Page_Load(object sender, EventArgs e)
    {
           }
    protected void Button1_Click(object sender, EventArgs e)
    {
        StringBuilder sb = new StringBuilder();
sb.Append("<form id='tempForm' name='tempForm'  action='Default.aspx' method='post' target='_blank' >");
                sb.Append("<input type='hidden' name='userName' value='" + txtName.Text.ToString() + "'>");
        sb.Append("<input type='hidden' name='userPwd' value='" + txtPwd.Text.ToString() + "'>");
        sb.Append("<input type='hidden' name='s' value='" + txts.Text.ToString() + "'>");
        sb.Append("</form><script>document.getElementById('tempForm').submit();</script>");        formStr = sb.ToString();
        Response.Write(formStr);    }
    protected void TextBox2_TextChanged(object sender, EventArgs e)
    {    }
}