UserControls

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
 
K

Kevin Spencer

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top