开发者

Set attribute with JS and grab it by controlID in code-behind

开发者 https://www.devze.com 2023-01-13 09:05 出处:网络
After postback, attributes are cleared. So how can I send an attribute applied to controlID via JS to the ne开发者_运维知识库xt request page?

After postback, attributes are cleared.

So how can I send an attribute applied to controlID via JS to the ne开发者_运维知识库xt request page?

Thanks in advance!


Javascript and ASP.Net controls can have a rather strained relationship. The main thing to remember is that ASP.Net needs to be able to get a value/see a change. Custom attributes may not be kept during a post back.

Have you tried storing the info using a hidden control?

<asp:HiddenField ID="id" Value="value" />

MSDN ref

0

精彩评论

暂无评论...
验证码 换一张
取 消