自定义ASP。NET服务器端控件,关于视图保存的问题,急!!
luxel 2004-09-30 03:30:54 自己开发的服务器端控件 CustomControl
public class CustomControl : WebControl
{
public MyClass Class
{
get { return (MyClass) ViewState["Class"];}
}
public CustomControl
{
ViewState["Class"] = new MyClass();
}
}
[TypeConverter(typeof(MyClassConverter))]
[Serializable()]
public MyClass class // 此类已经实现了Converter,并且能被序列化
{
}
可是,在往返过程中,这个属性的状态无法被保存下来,其他的string 属性的状态可以正常保存
现在这个问题十万火急,而且思路有点乱,哪位高人能帮忙指点迷津,或者说说在写这种要保存在视图里的类的时候的注意问题,帮忙理一下思路也好呀!!!!!(由于代码太多,所以没能贴上来)