button in the usercontrol

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • xkeops@gmail.com

    #1

    button in the usercontrol

    I'm working in VS2003 VB.NET environment.
    I created a based class template (BasePage) and there is a new aspx
    win form (winform1.aspx)
    inheriting BasePage.

    In winform1.aspx I have added a new usercontrol uc1 and in uc1 I have
    a textbox and a
    save button (btn_Save).

    When I click the save button the btnSave_Click event doesn't fire.
    Only second time I click it does.

    What am I doing wrong? I need to save the usercontrol data and I was
    thinking to put the
    code inside my uc1.

    Thanks,
    xke

  • rowe_newsgroups

    #2
    Re: button in the usercontrol

    On Feb 1, 9:42 am, xke...@gmail.co m wrote:
    I'm working in VS2003 VB.NET environment.
    I created a based class template (BasePage) and there is a new aspx
    win form (winform1.aspx)
    inheriting BasePage.
    >
    In winform1.aspx I have added a new usercontrol uc1 and in uc1 I have
    a textbox and a
    save button (btn_Save).
    >
    When I click the save button the btnSave_Click event doesn't fire.
    Only second time I click it does.
    >
    What am I doing wrong? I need to save the usercontrol data and I was
    thinking to put the
    code inside my uc1.
    >
    Thanks,
    xke
    Is it PostingBack on the first click?

    Thanks,

    Seth Rowe

    Comment

    • xkeops@gmail.com

      #3
      Re: button in the usercontrol

      Yes it does PostBack into Page_Load event on both usercontrol and the
      winform.aspx parent page.






      On Feb 1, 10:19 am, "rowe_newsgroup s" <rowe_em...@yah oo.comwrote:
      On Feb 1, 9:42 am, xke...@gmail.co m wrote:
      >
      >
      >
      >
      >
      I'm working in VS2003 VB.NET environment.
      I created a based class template (BasePage) and there is a new aspx
      win form (winform1.aspx)
      inheriting BasePage.
      >
      In winform1.aspx I have added a new usercontrol uc1 and in uc1 I have
      a textbox and a
      save button (btn_Save).
      >
      When I click the save button the btnSave_Click event doesn't fire.
      Only second time I click it does.
      >
      What am I doing wrong? I need to save the usercontrol data and I was
      thinking to put the
      code inside my uc1.
      >
      Thanks,
      xke
      >
      Is it PostingBack on the first click?
      >
      Thanks,
      >
      Seth Rowe- Hide quoted text -
      >
      - Show quoted text -

      Comment

      • rowe_newsgroups

        #4
        Re: button in the usercontrol

        On Feb 1, 11:39 am, xke...@gmail.co m wrote:
        Yes it does PostBack into Page_Load event on both usercontrol and the
        winform.aspx parent page.
        >
        On Feb 1, 10:19 am, "rowe_newsgroup s" <rowe_em...@yah oo.comwrote:
        >
        On Feb 1, 9:42 am, xke...@gmail.co m wrote:
        >
        I'm working in VS2003 VB.NET environment.
        I created a based class template (BasePage) and there is a new aspx
        win form (winform1.aspx)
        inheriting BasePage.
        >
        In winform1.aspx I have added a new usercontrol uc1 and in uc1 I have
        a textbox and a
        save button (btn_Save).
        >
        When I click the save button the btnSave_Click event doesn't fire.
        Only second time I click it does.
        >
        What am I doing wrong? I need to save the usercontrol data and I was
        thinking to put the
        code inside my uc1.
        >
        Thanks,
        xke
        >
        Is it PostingBack on the first click?
        >
        Thanks,
        >
        Seth Rowe- Hide quoted text -
        >
        - Show quoted text -
        Is this UC dynamically added? If so this is a fairly common problem
        and is covered multiple times in the asp.net newsgroup. Try out the
        below link for some solutions (hopefully) to the problem:



        Thanks,

        Seth Rowe

        Comment

        • xkeops@gmail.com

          #5
          Re: button in the usercontrol

          Seth, thanks a lot. It did solve my problem.

          Instead of
          Me.Main.Control s.Add(Me.LoadCo ntrol("usercont rol/
          myusercontrol.a scx"))

          I have specified the ID for the dynamically added control:

          mDynamicCtl = Me.LoadControl( "usercontro l/
          myusercontrol.a scx")
          mDynamicCtl.ID = "kbCont"
          Me.Main.Control s.Add(mDynamicC tl)

          Now it works. Much apreciate your help!!!!!!!

          xke



          On Feb 1, 11:49 am, "rowe_newsgroup s" <rowe_em...@yah oo.comwrote:
          On Feb 1, 11:39 am, xke...@gmail.co m wrote:
          >
          >
          >
          >
          >
          Yes it does PostBack into Page_Load event on both usercontrol and the
          winform.aspx parent page.
          >
          On Feb 1, 10:19 am, "rowe_newsgroup s" <rowe_em...@yah oo.comwrote:
          >
          On Feb 1, 9:42 am, xke...@gmail.co m wrote:
          >
          I'm working in VS2003 VB.NET environment.
          I created a based class template (BasePage) and there is a new aspx
          win form (winform1.aspx)
          inheriting BasePage.
          >
          In winform1.aspx I have added a new usercontrol uc1 and in uc1 I have
          a textbox and a
          save button (btn_Save).
          >
          When I click the save button the btnSave_Click event doesn't fire.
          Only second time I click it does.
          >
          What am I doing wrong? I need to save the usercontrol data and I was
          thinking to put the
          code inside my uc1.
          >
          Thanks,
          xke
          >
          Is it PostingBack on the first click?
          >
          Thanks,
          >
          Seth Rowe- Hide quoted text -
          >
          - Show quoted text -
          >
          Is this UC dynamically added? If so this is a fairly common problem
          and is covered multiple times in the asp.net newsgroup. Try out the
          below link for some solutions (hopefully) to the problem:
          >
          http://groups.google.com/group/micro...framework.aspn...
          >
          Thanks,
          >
          Seth Rowe- Hide quoted text -
          >
          - Show quoted text -

          Comment

          Working...