首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

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

2012-01-13 
控件属性怎么去自动获取值在前台页面里属性怎么获取Request参数如Cai:TextBoxwhere type{xx} runat

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

热点排行