关于重写页面中的loadviewstate和saveviewstate
using System;using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Label1.Text = "aaaaaa";
ViewStateControl1.ViewStateText = "visual studeo";
}
}
protected override void LoadViewState(object savedState)
{
}
protected override object SaveViewState()
{
}
protected override void Render(HtmlTextWriter writer)
{
Response.Write("只显示render部份");
base.Render(writer);
Response.End();
}
}
我在页面中重写了loadviewstate和saveviewstate后,那上述代码中,是不是同样可以达到禁用控件的状态呢?因为在loadviewstate和saveviewstate中没有写任何代码!可不可以达到呢?