类库说明文档
![]() | JHWebControlGetValueTtype Method (Control, String) |
获取控件指定属性的值,如果获取值为 null 则返回 default(Ttype),异常直接抛出
Namespace: DCSoft.Utility.Web
Assembly: DCSoft.Utility (in DCSoft.Utility.dll) Version: 0.0.0.0 (1.0.0.0)

C#
public static Ttype GetValue<Ttype>( Control control, string propertyName ) where Ttype : IConvertible
Parameters
- control
- Type: System.Web.UIControl
Web 服务器控件 - propertyName
- Type: SystemString
属性名称,不区分大小写
Type Parameters
- Ttype
- 要返回值的类型
Return Value
Type: Ttype返回转换后的获取值

属性不存在或者没有 get 访问器,则读取 Attributes 中的值
