asp.net獲得html標(biāo)簽值的方法:1、通過加【runat="server"】方法,代碼為【<input id="Text1" runat="server" type="text" />】;2、直接獲取方法。
本教程操作環(huán)境:windows7系統(tǒng)、html5版,DELL G3電腦。
asp.net獲得html標(biāo)簽值的方法:
兩種方法:
1、加runat="server"
<input id="Text1" runat="server" type="text" />
后臺獲取 string str=this.Text1.value;
2、直接獲取
<input id="Text1" name="GetValue" type="text" /> string str=Request.Form["GetValue"];
相關(guān)學(xué)習(xí)推薦:html視頻教程