开发者

asp:TextBox - override Text property

How do I override the开发者_JAVA技巧 TextBox property "Text" (getter) ?


According to MSDN the property is virtual so you should be able to override like so:

class MyTextBox : TextBox {
 public override string Text 
{
 get { return /* return what you wish*/; }
 set { /**/ }
}
}

You can also override one of the Render methods to have full control of generated HTML. Though perhaps you had something else in mind?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜