日期:2014-05-18  浏览次数:20476 次

控件属性怎么去自动获取值
在前台页面里属性怎么获取Request参数

如   <Cai:TextBox     where= "type={xx} "   runat= "server "   />
我想让{xx}   去获取Request[ "type "]的值

意思是这样的,但是写是错误的,应该怎么写呢
<asp:TextBox     where= "type= <%#Request[ "type "]%> "   runat= "server "   />

------解决方案--------------------
<Cai:TextBox where= "type={xx} " runat= "server " id= "x " />
PageLoad:
x.where = Request[ "type "];
------解决方案--------------------
<asp:TextBox where= "type= <%#Request[ "type "]%> " runat= "server " />

》》》

<asp:TextBox id=MyTextBox1 where= ' <%# "type= " + Request[ "type "]%> ' runat= "server " />

然后需要显示调用
MyTextBox1.DataBind(); // 执行绑定

或者

Page.DataBind();