单击事件
{
Response.Redirect("yyy.aspx?aa="+textbox.text);
}
{
Response.Redirect("yyy.aspx?aa="+textbox.text);
}
解决方案 »
- c# .net 计算时间天数差值
- IE8中alert失败,求救啊,很急!!!
- foreach如何历篇二唯数据或更多唯的数据?
- 今天更新了系统补丁,应用程序出现问题
- 求简单正则表达式!在线等马上给分。
- 请大家看看1+1=?这个贴,跪求,我都没分了(我真是想知道是怎么回事)
- 调用存储过程,output 类型的变量需要特别设置嘛?
- asp.net从SQL2000数据库查询记录。
- 数据库与XML的通用转换
- asp.net应用程序在windows server 2008上出现问题
- 求一个算法。。路过的进来看看~~~~
- 用VS2008编写的asp.net程序,发布时就一定要安装.net framework3.5吗?
protected void buttn_Click(object sender, EventArgs e)
{
//把aa传到yyy页面
Response.Redirect("yyy.aspx?aa="+textbox.Text);
}
2:button有一个PostBackUrl="2.aspx",这样你就可以在2.aspx页面获取所有button所在页面的数据,通过Page.PreviousPage
xx.aspx?id=xxx
这种方式
//在yyy页面定义字符串了接值
string aaa = Request.QueryString["aa"].ToString();
如果你的数据量不是很大,用我说的就行了
了另一个页面如楼上:yyy.aspx
你用Request.QueryString["aa"]取值!
你到google上搜索,asp.net页面传值,
有很多,在不同情况的,传值的方法!!!
{
//把aa传到yyy页面
Response.Redirect("Index.aspx?name="+textbox.Text.Trim());
Response.Write("<scrpt>window.location.href='Index.aspx?name="+textbox.Text.Trim()';</script>")
}Index.asp.cs
string name=Request.QueryString["name"].ToString();
{
Response.Redirect("yyy.aspx?aa="+textbox.text);
}
另一页面
string aaa = Request.QueryString["aa"].ToString();aaa就是你需要的值
function OpenClickWindow(str)
{
var iWidth=?; //窗口宽度
var iHeight=?;//窗口高度
var iTop=(window.screen.height-iHeight)/2;
var iLeft=(window.screen.width-iWidth)/2; if(strNum=='')
strNum='?';
var win=window.open("URL?Pid="+str,"web_Module","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,left="+iLeft+",top="+iTop+",width="+iWidth+",height="+iHeight);
win.focus();
return false;
}
然后就是button的onclick事件了,带的参数就是你要传的textbox的值
function OpenClickWindow(str)
{
var iWidth=?; //窗口宽度
var iHeight=?;//窗口高度
var iTop=(window.screen.height-iHeight)/2;
var iLeft=(window.screen.width-iWidth)/2;
var win=window.open("URL?Pid="+str,"窗口名","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,left="+iLeft+",top="+iTop+",width="+iWidth+",height="+iHeight);
win.focus();
return false;
}
在.net中,如果通过Button传值,它有一种PostBackUrl方法:
Default.aspx:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" PostBackUrl="~/Default2.aspx" />Default2.aspx:
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> protected void Page_Load(object sender, EventArgs e)
{
this.Label1.Text = ((TextBox)PreviousPage.FindControl("TextBox1")).Text;
}
{
Session["a"]=textbox.Text.ToString();
Response.Redirect("//传到的页面");
}
在传到的页面中Page_Lode中
{
this.textbox1.Text=Session["a"].Tostring();
}只要你不关闭页面Session就不会消失,你要跳到其他页面,这个Session["a"]里的值依然存在.
不知道这样行不行?