ascx problem

Discussion in 'ASP .Net Web Controls' started by Lyuba, Jan 19, 2004.

  1. Lyuba

    Lyuba Guest

    Hi
    I have a problem with user controls in asp.net

    I have an aspx page that has a System.Web.UI.WebControls.PlaceHolder. On page load I have code that loads page1.ascx control on the placeholder. page1.ascx has button "next", on click it clears placeholder on aspx page and loads page2.ascx on the placeholder
    The problem is on page2.ascx. It has "next" button but on click only client side processing works. In my page2.cs I have routine that supposed to store data to a db and then clear placeholder and load next control. I've debugged it step by step - it never gets into the next click event handler

    What am I doing wrong? Please help

    Thank you in advanc

    Lyuba
    Lyuba, Jan 19, 2004
    #1
    1. Advertising

  2. Hi Lyuba,

    If you are loading the UC in a postback event (a click for instance) then
    all its child controls won't fire events propertly as it is just too late as
    key events have already been fired. Please take a look in the docs at how
    the Control lifecycle works to learn what events are fired and in which
    order.

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup

    "Lyuba" <> wrote in message
    news:...
    > Hi,
    > I have a problem with user controls in asp.net.
    >
    > I have an aspx page that has a System.Web.UI.WebControls.PlaceHolder. On

    page load I have code that loads page1.ascx control on the placeholder.
    page1.ascx has button "next", on click it clears placeholder on aspx page
    and loads page2.ascx on the placeholder.
    > The problem is on page2.ascx. It has "next" button but on click only

    client side processing works. In my page2.cs I have routine that supposed to
    store data to a db and then clear placeholder and load next control. I've
    debugged it step by step - it never gets into the next click event handler.
    >
    > What am I doing wrong? Please help!
    >
    > Thank you in advance
    >
    > Lyuba
    Victor Garcia Aprea [MVP], Jan 22, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Quentin
    Replies:
    1
    Views:
    487
    Quentin
    Jul 29, 2003
  2. Jason Shohet
    Replies:
    1
    Views:
    482
    Kevin Spencer
    Nov 10, 2003
  3. Holger (David) Wagner
    Replies:
    2
    Views:
    1,940
    Holger (David) Wagner
    Jul 3, 2004
  4. Joe
    Replies:
    1
    Views:
    372
    Jeffrey Tan[MSFT]
    Feb 16, 2004
  5. Replies:
    2
    Views:
    536
Loading...

Share This Page