User Controls/Design Best Practices

G

Guest

In traditional ASP I used to pretty much replicate what is now being done in
ASP.NET 2.0 with the master pages. I would create a header include file that
included everything up to the main content cell, and a footerthat included
the rest. I've been creating header user controls in asp.net but have run
into problems.

1) How do I work around only being allowed 1 form for page? If my user
control has server controls and a form in it, and so does my page, how can
they co-exist?

2) How can I programmatically access elements (i.e. a label or panel) in
the UC from the page that holds the user control.

Thanks, I appreciate the help!
 
D

DWinter

Ok, I assume you have your UC declared something like this?
<uc1:myUserControl id="myUC" runat="server" />

Well you reference the controls in the UserControl part with
myUC.controlID.Value
where in the page that is hosting the user control would be just
controlID.Value.
 

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

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top