如何让自定义控件原来的width和height属性可用
- 作者:zhaozj
- 发表时间:2020-12-23 10:38
- 来源:未知
需要使控件继承自webcontrol
并在重写的Render方法中这样写:
Dim theWidth As String = Me.Width.ToStringDim theHeight As String = Me.Height.ToString
output.AddAttribute(HtmlTextWriterAttribute.Height, theHeight)output.AddAttribute(HtmlTextWriterAttribute.Width, theWidth)