UserControls

  • Thread starter Thread starter Dani
  • Start date Start date
D

Dani

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
 
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.
 
Back
Top