传递价值 [英] Passing Values
本文介绍了传递价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将值从一页传递到下一页.但是它没有通过.我需要使用会话或隐藏该值的任何其他方法来完成它.这就是我尝试过的.
第1页:
I am trying to pass values from a page to next page. But its not getting passed. I need it to be done using session or anyother method where the value is hidden. This is what i tried.
Page 1 :
<pre lang="cs">protected void Button1_Click(object sender, EventArgs e)
{
Session["Name"] = GridView1.FooterRow.Cells[3].Text;
Response.Redirect("~/memberpages/checkout.aspx");
}
和第2页:
And Page 2 :
<pre lang="cs">protected void Page_Load(object sender, EventArgs e)
{
if (Session["Name"] != null)
TextBox1.Text = Session["Name"].ToString();
}
我想我错过了问题中的某些内容...实际上,我在gridview的页脚行的第3列中有一个值,我需要将该值传递到下一页..是我使用的代码是正确的...
Edit :
i think i missed something in the question... its actually i have a value in the 3rd column of the footer row in gridview which i need to pass to next page.. is that code which i used is correct...
推荐答案
调试并检查GridView1.FooterRow.Cells[3].Text;
是否确实具有值.
Debug and check if GridView1.FooterRow.Cells[3].Text;
does indeed have a value.
您看到这篇文章了吗?
将页面值传输到另一个页面 [发布到ASP.NET 2.0中的另一个页面 [
Did you see this article ?
Transferring page values to another page[^]
Or
Post To Another Page in ASP.NET 2.0[^]
:rose:
这篇关于传递价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文