原来Localizable AttributeProperty是这么回事呀
在我前天写的随笔开发和使用自定义服务器控件中,一直对属性为什么要使用Localizable(true)不清楚。
查了许多关于WEB控件开发的资料,其中都对这个AttributeProperty做了忽略,原来只有当控件的属性声明为Localizable(true)时,VS的生成本地资源工具才会扫描到。
在我前天写的随笔开发和使用自定义服务器控件中,一直对属性为什么要使用Localizable(true)不清楚。
[
Bindable( true ),
Category( " Appearance " ),
DefaultValue( " Hello " ),
Description( " The welcome message text. " ),
Localizable( true )
]
public virtual string Text
{
get
{
string s = ( string )ViewState[ " Text " ];
return (s == null ) ? " Hello " : s;
}
set
{
ViewState[ " Text " ] = value;
}
}
Bindable( true ),
Category( " Appearance " ),
DefaultValue( " Hello " ),
Description( " The welcome message text. " ),
Localizable( true )
]
public virtual string Text
{
get
{
string s = ( string )ViewState[ " Text " ];
return (s == null ) ? " Hello " : s;
}
set
{
ViewState[ " Text " ] = value;
}
}
查了许多关于WEB控件开发的资料,其中都对这个AttributeProperty做了忽略,原来只有当控件的属性声明为Localizable(true)时,VS的生成本地资源工具才会扫描到。
![](http://www.cnblogs.com/CuteSoft_Client/CuteEditor/images/emteeth.gif)