Server Controls in header file

M

Marcus Robinson

Hi,

I have files called header.ascx and footer.ascx which are included in pages
by a class that inherits System.Web.UI.Page and overides OnInit. See:
-------------------------
Protected Overrides Sub OnInit(ByVal e As System.EventArgs)

Me.Controls.AddAt(0, LoadControl("../header.ascx"))
MyBase.OnInit(e)
Me.Controls.Add(LoadControl("../footer.ascx"))

End Sub
--------------------------

I would like have a DropDownList server control (amongst others) in my
header. How can I achieve this. I am having problems with multiple form
tags and such like.

All help is much appreciated, if you need any more info please ask, thanks
in advance,

Marcus Robinson

The Programming Pages - http://www.programmingpages.com
Mr ICT Web Hosting - http://www.mrict.co.uk
 
S

S. Justin Gengo

Marcus,

You should never put form tags into a .ascx control. The only form tags
should be on the .aspx page itself. Then when you drop your control onto the
form it get's included inside of the .aspx page's form.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 

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,779
Messages
2,569,606
Members
45,239
Latest member
Alex Young

Latest Threads

Top