UserControls

Discussion in 'ASP .Net' started by Dani, Oct 17, 2003.

  1. Dani

    Dani Guest

    hi

    First of all: sorry for my bad english :)

    I've got a problem with usercontrols - and no idea how to fix it! :-(

    I had registered a usercontrol navigation.ascx in the common-way
    (page-directive and declared in aspx-page). This usercontrol has several
    linkbuttons in it, who raises click()-events... in this click-event, I set a
    property with the name of a second usercontrol.

    In the prerender-eventhandler of page I load this second usercontrol
    dynamicly with the loadcontrol()-method. this works fine.

    my problem is, that i've got an webform in the second usercontrol, and when
    i submit this - nothing happens... i've declared an click-event for the
    submit-button there, but this event is never running.

    funny is, that when i load this usercontrol in the page_load-eventhandler
    instead of the onprerender-event all works fine. but i have to load this in
    onprerender, because of the linkbuttons-click event in navigation.ascx....

    i hope you can help me
    dani
    Dani, Oct 17, 2003
    #1
    1. Advertising

  2. The problem is that you can't nest WebForms inside other WebForms, which is
    what happens when you put a User Control containing a Web Form inside
    another WebForm. In fact, you can't nest HTML forms inside other HTML forms,
    so you can't put another form inside your ASPX page, unless it is (1) a
    regular HTML form, and (2) it is outside of the WebForm.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Big Things are made up of
    Lots of Little Things.

    "Dani" <> wrote in message
    news:...
    > hi
    >
    > First of all: sorry for my bad english :)
    >
    > I've got a problem with usercontrols - and no idea how to fix it! :-(
    >
    > I had registered a usercontrol navigation.ascx in the common-way
    > (page-directive and declared in aspx-page). This usercontrol has several
    > linkbuttons in it, who raises click()-events... in this click-event, I set

    a
    > property with the name of a second usercontrol.
    >
    > In the prerender-eventhandler of page I load this second usercontrol
    > dynamicly with the loadcontrol()-method. this works fine.
    >
    > my problem is, that i've got an webform in the second usercontrol, and

    when
    > i submit this - nothing happens... i've declared an click-event for the
    > submit-button there, but this event is never running.
    >
    > funny is, that when i load this usercontrol in the page_load-eventhandler
    > instead of the onprerender-event all works fine. but i have to load this

    in
    > onprerender, because of the linkbuttons-click event in navigation.ascx....
    >
    > i hope you can help me
    > dani
    >
    >
    Kevin Spencer, Oct 17, 2003
    #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. Andreas Klemt
    Replies:
    0
    Views:
    389
    Andreas Klemt
    Jul 8, 2003
  2. Charles A. Lackman

    className Attribute (UserControls)

    Charles A. Lackman, Jul 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    418
    Charles A. Lackman
    Jul 8, 2003
  3. Antonio Maciel

    Validator controls and usercontrols

    Antonio Maciel, Jul 9, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    376
    Antonio Maciel
    Jul 9, 2003
  4. Jody Fisher

    Re: Using UserControls in a DLL

    Jody Fisher, Jul 29, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    436
    Sam Vanderstraeten
    Jul 29, 2003
  5. SamIAm
    Replies:
    2
    Views:
    404
    SamIAm
    Aug 21, 2003
Loading...

Share This Page