开发者

How to get values of non-asp controls in an asp.net project?

开发者 https://www.devze.com 2023-01-01 07:20 出处:网络
I would like to know how to get the values from non-asp controls in my C# code? Can someone help me 开发者_C百科with this? Thanks.You can apply the runat=\"server\" tag to standard HTML controls, as w

I would like to know how to get the values from non-asp controls in my C# code? Can someone help me 开发者_C百科with this? Thanks.


You can apply the runat="server" tag to standard HTML controls, as well. Absent doing that, you can also check the Request object in your code.

string foo = Request.Form["controlName"];


If the control is embedded inside a <form> tag you can use the Request["<control name>"]

0

精彩评论

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