public enum TextReadOnly
{
Yedit=0,//可录入
Nedit=1
}
public enum DataValidate
{
Yvalidate = 0,//可验证
Nvalidate = 1
}
public partial class pub_ddl02 : System.Web.UI.UserControl
{
public virtual TextReadOnly TextEdit
{
get
{
object textedit = ViewState[ "TextEdit "];
if (textedit== null)
return TextReadOnly.Yedit;
else
return (TextReadOnly)TextEdit;
}
set
{
ViewState[ "TextEdit "] = value;
}
}
public virtual DataValidate Validate
{
get
{
object validate = ViewState[ "Validate "];
if (validate == null)
return DataValidate.Yvalidate;
else
return (DataValidate)validate;
}
set
{
ViewState[ "Validate "] = value;
}
}
}
------解决方案--------------------------------------------------------
这种错误就是产生了递归调用
这个属性改成
public virtual TextReadOnly TextEdit
{
get
{
object textedit = ViewState[ "TextEdit "];
if (textedit == null)
return TextReadOnly.Yedit;
else
return (TextReadOnly)textedit;//不是TextEdit