如何将一个页面中的隐藏字段值传递给其他页面 [英] How do I pass a hidden field value in one page to other page

查看:86
本文介绍了如何将一个页面中的隐藏字段值传递给其他页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我要求在按钮点击时将一个页面中的隐藏字段值传递给其他页面,我们对点击事件的验证很少。我不应该使用查询字符串概念和会话变量概念。当我使用server.transfer实现时,我收到错误,因为我的按钮在更新面板中。是否有任何替代方法来实现此要求?



在此先感谢,

Ramakrishna。

解决方案





你可以使用任何一个以下方法..



饼干



SET:



 HttpCookie cookName =  new  HttpCookie( < span class =code-string>名称); 
cookName.Value = Pandian;



GET:



  string  name = Request。 Cookies [ 名称]。价值; 





------



申请变量



SET:



应用程序[  Name] =   pandian; 



GET:



  string 名称=应用程序[ 名称]。ToString(); 


您查过这篇文章:



使用C#在Asp.Net中使用隐藏字段将值从一个页面传递到另一个页面[ ^ ]



请看看吧。



如果仍然无法完成,请按照文章中的其他步骤进行操作:

http://www.codedigest.com/Articles/ASPNET/351_How_to_Pass_Values_from_One_Page_to_Another_in_ASPNet.aspx [ ^ ]


请参阅下面的类似问题。



传递价值fr使用C#在Asp.Net中使用隐藏字段将一页转到另一页[ ^ ]


Hello,

I have a requirement to pass a hidden field value in one page to other page on button click and we have few validation on click event. I should not use query string concept and session variable concept. when I implementing with server.transfer I am getting error because my button is in update panel.Is there any alternative method to achieve this requirement?

Thanks In Advance,
Ramakrishna.

解决方案

Hi,

you can use any one of the following method..

Cookies

SET :

HttpCookie cookName = new HttpCookie("Name");
cookName.Value = "Pandian";


GET :

string name = Request.Cookies["Name"].Value;



------

Application Variables

SET :

Application["Name"] = "pandian";


GET :

string Name = Application["Name"].ToString();


Have you checked this post :

Passing value from one page to another using Hidden Field in Asp.Net Using C#[^]

Pls have a look at it.

If still not able then follow one of the alternative steps in the article:
http://www.codedigest.com/Articles/ASPNET/351_How_to_Pass_Values_from_One_Page_to_Another_in_ASPNet.aspx[^]


Please refer below for similar question.

Passing value from one page to another using Hidden Field in Asp.Net Using C#[^]


这篇关于如何将一个页面中的隐藏字段值传递给其他页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆