Syp*_*ess 8 asp.net custom-server-controls custom-controls
编写自定义控件时,它始终呈现为HTML span元素.如何将其更改为div?
从WebControl导出控件,如下所示:
public class MyCustomControl : WebControl {
public MyCustomControl() : base(HtmlTextWriterTag.Div) {}
}
Run Code Online (Sandbox Code Playgroud)
也就是说,使用接受要使用的标记的基类构造函数.
归档时间: |
|
查看次数: |
1166 次 |
最近记录: |