开发者

asp:TextBox - override Text property

开发者 https://www.devze.com 2023-02-15 18:43 出处:网络
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:

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

精彩评论

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

关注公众号