Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > User Controls/Design Best Practices

Reply
Thread Tools

User Controls/Design Best Practices

 
 
=?Utf-8?B?TmF0aGFuVg==?=
Guest
Posts: n/a
 
      10-02-2004
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!




 
Reply With Quote
 
 
 
 
DWinter
Guest
Posts: n/a
 
      10-02-2004
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.


"NathanV" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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!
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Codeplex sample for showing best coding practices? John Dalberg ASP .Net 3 11-16-2006 12:07 PM
User authentication in Tomcat -- best practices? Eduardo Java 3 08-31-2004 07:25 AM
Best design practices for user control interaction Josh Harris ASP .Net 4 04-17-2004 12:01 AM
Best sample app for learning best practices, OO & asp.net? karim ASP .Net 0 07-13-2003 04:26 AM
web form user control best practices? noname ASP .Net 0 06-26-2003 03:09 PM



Advertisments