request.form["name"]值为null
.aspx页面
<form id="form1" runat="server">
....
<input type="text" class="text_R" name="txtusername" id="txtusername" />
....
</form>
.aspx.cs代码:
实现过ICallbackEventHandler接口
protected void Page_Load(object sender,EventArgs)
{
ClientScriptManager cm=Page.ClientScript;
String cbReference=cm.GetCallbackEventReference(this,"arg","GetServerData","context");
String clientScript="function CallServer{"+cbReference+"}";
cm.RegisterClientScriptBlock(this.GetType(),"CallServer",clientScript,true);
string a=request.form["txtusername"]//值怎么一直是空
}
我想取到aspx页面中html标签的值,怎么做?
------解决方案--------------------post方式才能取到值吧
------解决方案--------------------protected void Page_Load
这写在这里,你有post动作没有?
------解决方案--------------------看下Request["txtusername"]是否有值.
------解决方案--------------------
你的值应该找CallServer要,而不是找Page_Load要