Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

ViusalWebPart not retrieving ViewState on Page_Load even if EnableViewState = ture

public uint ItemsCount
 {
  get
   {
       if (ViewState["ItemsCount"] != null)
             return (uint)ViewState["ItemsCount"];
                return 1;
   }
  set
  {
        ViewState["ItemsCount"] = value;
  }
}  

Here the Page_Load block

if (!IsPostBack)
   ItemsCount = (uint)SharePointHelper.SharePointHelper.GetListItemsCount(EventListName, "");

every time ItemsCount back as 1, any guesses? - SharePoint Server 2010 -

share|improve this question

1 Answer

can you plese check the visual webaprt life cycle http://blogs.msdn.com/b/guruketepalli/archive/2011/11/29/visual-web-part-life-cycle.aspx

share|improve this answer
not that helpful, even the LoadViewState handler never hit be the compiler in UserControl, could you please direct me to what i did wrong? – Remon Jan 12 '12 at 11:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.