I have created visual webpart in SharePoint 2010 which will generate class file for class derived from Webpart and second for UserControl. Now I have TabStrip Control on .ascx markup. Now I want to add tab in Tabstrip control only once so how can check for Ispostback in userControl ?

protected void Page_Load(object sender, EventArgs e) {

            if (!this.IsPostBack) {


I have used above code this work but once I add webpart I don't see tabs in design mode and then I refresh page again I can see tabs.

Please advise

  • Have you placed a break point in there to confirm that you are definitely not getting into your if statement? Jul 18, 2012 at 16:36
  • Is it only in the postback where you add the webpart it's missing or whenever it's in design mode? The first is expected with this code Jul 18, 2012 at 16:52
  • Thanks Abe for your quick reply.yes i did and i am not getting to code in if statement if i add webpart to webpartzone but once go back to page and refresh i can see tabs i am sure i am missing some lifecycle of events here but dont know
    – Ronak
    Jul 18, 2012 at 16:53
  • Thanks Per It is missing when i add webpart and after then if i edit page again i can see tabs.
    – Ronak
    Jul 18, 2012 at 16:54

1 Answer 1


Use (!this.Page.IsPostBack) in Sharepoint

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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