Master page and form

S

Shelly

First: I have a master page that has the form tag in it. My content page,
on one occasion, needs a different type of form (uploading files needs
encytype="multipart/form-data"). I solved this by duplicating the master
page and changing the form tag -- but this seems to defeat the purpose of
the master page. (Changing something in one would require changing in the
other for consistency). Is there some way to override the specific of the
form tag while in the content page?

Second: I some of my content pages can get quite large. I would like to be
able to take sections of a large page and place that content in a separate
file and then include that file. Is this possible in aspx? As an example,
suppose I have one area that has a whole set of checkboxes for
property_type_1 and another with a whole set of other checkboxes for
property_type_2 and each of these is extensive code. Can I put the
property_type_x in separate files and simply include them somehow in the
content page? It makes for much easier viewing of the code.

Shelly
 
B

bruce barker

if you use <input type=file runat=server> (HtmlInputFile), it
automatically sets enctype="multipart/form-data" if it has not been set
to a value. so you do not need to specify the attribute at all in the
master page. you can also set it in the code behind with:

this.Page.Form.Enctype="multipart/form-data";


user controls (ascx) are asp.net's version of includes.

-- bruce (sqlwork.com)
 
C

clintonG

The #include directive is still supported and often easier to use in content
pages than User Controls.

I think User Controls are best used when other controls which generate HTML
must be reused but when the content being reused in a content page is simply
text the #include directive remains the more efficient choice for me.

Its a judgement call and this context as I've explained is the way I've
chosen to use both methodologies to my advantage.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
 

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

Staff online

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top