property curRefID:
public string curRefID
{
get
{
return ViewState ["curid"] as string;
}
set
{
ViewState ["curid"] = value;
}
}
Run Code Online (Sandbox Code Playgroud)
我在方法InitUCControl()中初始化它
protected override void OnInit ( EventArgs e )
{
base.OnInit ( e );
if ( !IsPostBack )
{
InitUCControl ( );
}
}
Run Code Online (Sandbox Code Playgroud)
然后我想在按钮单击事件中使用该属性,它始终返回null.但是当我在InitUCControl()中调试它时它有一个值.我不知道为什么它不能工作......太奇怪了.ps:我没有禁用viewstate.在页面的html源代码viewstate可以找到.
| 归档时间: |
|
| 查看次数: |
116 次 |
| 最近记录: |