如何在隐藏变量中传递ID。 [英] How to pass an ID in hidden variable.

查看:57
本文介绍了如何在隐藏变量中传递ID。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这可能很简单......

无论如何,我想在隐藏变量中传递一个值。我有这样的代码




< form ...>

< input type =" Hidden" ;命名= QUOT; ZZZ" value =" 1">

...

< / form>


我要替换值与另一个页面在

中生成后面的代码文件。我怎么做这样的事情?


问候

Ok, this is probably so simple...
Anyway, I''d like to pass a value in the hidden variable. I have code
like this:

<form...>
<input type="Hidden" name="zzz" value="1">
...
</form>

I want to replace the value with another when the page gets generated in
the code behind file. How do I do such a thing?

Regards

推荐答案

我会尽量避免这种情况如果可能的话,欺骗隐藏的字段是一个已知的

黑客,我在DevDays ASP.NET安全性讨论中,他们建议使用隐藏字段进行输入。
我认为会话状态

应该能满足您的需求,会话变量非常易于使用。

您熟悉它们吗?如果没有,我真的建议你查看它们。


干杯,


比尔

" Frank Rizzo <无** @ none.com>在消息中写道

新闻:e6 ************** @ TK2MSFTNGP09.phx.gbl ...
I''d try to avoid that if at all possible, spoofing hidden fields is a known
hack and I was at DevDays ASP.NET Security discussion and they were
recommended against using Hidden fields for input. I think Session State
should get you what you need and session variables are really easy to use.
Are you familiar with them? If not, I''d really suggest checking them out.

Cheers,

Bill
"Frank Rizzo" <no**@none.com> wrote in message
news:e6**************@TK2MSFTNGP09.phx.gbl...
好的,这可能是这么简单...
无论如何,我想在隐藏变量中传递一个值。我的代码是这样的:

< form ...>
< input type =" Hidden"命名= QUOT; ZZZ" value =" 1">
...
< / form>

我想在页面生成时用另一个替换值
文件背后的代码。我该怎么做?
Ok, this is probably so simple...
Anyway, I''d like to pass a value in the hidden variable. I have code
like this:

<form...>
<input type="Hidden" name="zzz" value="1">
...
</form>

I want to replace the value with another when the page gets generated in
the code behind file. How do I do such a thing?

Regards



使用HtmlInputHidden控件。


-

HTH,

Kevin Spencer

..Net开发人员

Microsoft MVP
大件物品组成

很多小东西。


Frank Rizzo <无** @ none.com>在消息中写道

新闻:e6 ************** @ TK2MSFTNGP09.phx.gbl ...
Use an HtmlInputHidden Control.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Frank Rizzo" <no**@none.com> wrote in message
news:e6**************@TK2MSFTNGP09.phx.gbl...
好的,这可能是这么简单...
无论如何,我想在隐藏变量中传递一个值。我的代码是这样的:

< form ...>
< input type =" Hidden"命名= QUOT; ZZZ" value =" 1">
...
< / form>

我想在页面生成时用另一个替换值
文件背后的代码。我怎么做这样的事情?

问候
Ok, this is probably so simple...
Anyway, I''d like to pass a value in the hidden variable. I have code
like this:

<form...>
<input type="Hidden" name="zzz" value="1">
...
</form>

I want to replace the value with another when the page gets generated in
the code behind file. How do I do such a thing?

Regards



他没有提到这些信息是否敏感,只有它

在隐藏的表格字段中。将数据放在一个隐藏的表单字段中,有很多充分的理由可以将数据放入显示中。我想到了ViewState,对于

的例子......


-

HTH,

Kevin Spencer

..Net开发人员

微软MVP

大件东西组成

很多小东西事情。


" William Ryan eMVP" <做******** @ comcast.nospam.net>在消息中写道

news:uc ************* @ TK2MSFTNGP11.phx.gbl ...
He didn''t mention whether this information is sensitive or not, only that it
is in a hidden form field. There are plenty of good reasons for putting data
that you don''t want displayed into a hidden form field. ViewState, for
example, comes to mind...

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:uc*************@TK2MSFTNGP11.phx.gbl...
我会尝试避免这种情况,如果可能的话,欺骗隐藏的字段是一个
已知的黑客,我在DevDays ASP.NET安全性讨论中,他们建议不要使用隐藏字段进行输入。我认为Session State
可以为您提供所需的内容,会话变量非常易于使用。
您熟悉它们吗?如果没有,我真的建议你查看它们。

干杯,

比尔
Frank Rizzo <无** @ none.com>在消息中写道
新闻:e6 ************** @ TK2MSFTNGP09.phx.gbl ...
I''d try to avoid that if at all possible, spoofing hidden fields is a known hack and I was at DevDays ASP.NET Security discussion and they were
recommended against using Hidden fields for input. I think Session State
should get you what you need and session variables are really easy to use.
Are you familiar with them? If not, I''d really suggest checking them out.

Cheers,

Bill
"Frank Rizzo" <no**@none.com> wrote in message
news:e6**************@TK2MSFTNGP09.phx.gbl...
好的,这可能就这么简单了.. 。
无论如何,我想在隐藏变量中传递一个值。我的代码是这样的:

< form ...>
< input type =" Hidden"命名= QUOT; ZZZ" value =" 1">
...
< / form>

我想在页面生成时用另一个替换值
文件背后的代码。我怎么做这样的事情?

问候
Ok, this is probably so simple...
Anyway, I''d like to pass a value in the hidden variable. I have code
like this:

<form...>
<input type="Hidden" name="zzz" value="1">
...
</form>

I want to replace the value with another when the page gets generated in
the code behind file. How do I do such a thing?

Regards




这篇关于如何在隐藏变量中传递ID。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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