我在我的主页BackReg.aspx中载入用户控件NewBackReg.ascx并且在控件中用post方法把数据传到UserCenter.aspx页面中
但我不管在NewBackReg.ascx中写<form ....></form>还是在BackReg.aspx写<form...></form>都不能传递到UserCenter.aspx中这是为什么,是不是<form></form>的问题应该怎么写<form...></form>请教大家了!!!我的NewBackReg.ascx中有服务器控件的
但我不管在NewBackReg.ascx中写<form ....></form>还是在BackReg.aspx写<form...></form>都不能传递到UserCenter.aspx中这是为什么,是不是<form></form>的问题应该怎么写<form...></form>请教大家了!!!我的NewBackReg.ascx中有服务器控件的
<input type="text" id="txtGet" runat="server" />
<input type="submit" id="btnOk" runat="server" value="确定" onserverclick="btnOk_Click" />protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
txtGet.Value = "(表单提交的值)";
}
} protected void btnOk_Click(object sender, EventArgs e)
{
Response.Redirect("../Page/receive.aspx?value=" + txtGet.Value.Trim(), true);
}
post页面:
在该页面放置上面的用户控件
<div>
<uc1:ucTest ID="ucTest" runat="server" />
</div>
post.aspx.cs (无)接收页面 receive
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string strValue = Request.QueryString["value"]; if (strValue != null)
{
Response.Write("当前页面是:" + this.Page.Title);
Response.Write("接收的值是:" + strValue);
Response.End();
}
}
}
运行没有问题的
http://blog.csdn.net/insus/archive/2008/01/21/2057539.aspx
如果不成功,请访问Insus.NET的blog:http://insus.cnblogs.com找到联系方式,与Insus.NET联系.