How to makeuse of IsPostPack Method inside UserControl?

How to makeuse of IsPostPack Method inside UserControl? 

IsPostBack method will always be true inside user control. You can use following alternate method to by pass this isse

 protected override void OnLoad(EventArgs e) {
base.OnLoad(e);
if (!IsUserControlPostBack)
{
///Write your code
}
}

//Make ReadOnly property.

protected bool IsUserControlPostBack{
get
{
   return this.ViewState["IsUserControlPostBack"] != null;
}

Hope this help..

Suresh Behera

13 Comments

Comments have been disabled for this content.