读书人

控件属性如何去自动获取值

发布时间: 2012-01-13 22:43:30 作者: rapoo

控件属性怎么去自动获取值
在前台页面里属性怎么获取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();

读书人网 >asp.net

热点推荐