HTML控件到C#代码背后 [英] HTML control to C# Code behind
本文介绍了HTML控件到C#代码背后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个HTML标签,例如
< input type =textid =amount/>
如何获得此标签的值在c#?
I have an HTML tag like
<input type="text" id="amount" />
How do i get the value of this label in c#?
推荐答案
您可以使用以下代码。
string value = Resquest.Form [ textboxname]。ToString();
You can use below code.
string value = Resquest.Form["textboxname"].ToString();
试试,
< input type =textid =amount runat =server/>
希望这对你有用。
try,
<input type="text" id="amount" runat="server" />
hopes this work for you.
这篇关于HTML控件到C#代码背后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文