473,320 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

enctype="multipart/form-data" for MasterPage

I have a MasterPage. The MasterPage actually contains the <formtag which is
used throughout the site.

On just certain pages that use that MasterPage, I need the "enctype" for the
<formtag to be set to:
enctype="multipart/form-data"

On the rest of the pages, I do not need this.

How can my specific ASPX page that uses the MasterPage change the
MasterPage's <form enctype=...just for that page? Or is there a better way?

Alex
Aug 14 '07 #1
2 7792
just set it in code behind inside the pages where it needs to be set:

this.Form.Enctype = "multipart/form-data";
"Alex Maghen" wrote:
I have a MasterPage. The MasterPage actually contains the <formtag which is
used throughout the site.

On just certain pages that use that MasterPage, I need the "enctype" for the
<formtag to be set to:
enctype="multipart/form-data"

On the rest of the pages, I do not need this.

How can my specific ASPX page that uses the MasterPage change the
MasterPage's <form enctype=...just for that page? Or is there a better way?

Alex
Aug 15 '07 #2
Hi Alex,

As Sergey has suggested, you can use code to programmatically set the
attributes of <formtag. And you can put the code in a proper page event
such as "Init" event. e.g.

==========
public partial class test_TestContentPage : System.Web.UI.Page
{
protected void Page_Init(object sender, EventArgs e)
{
this.Form.Enctype = "multipart/form-data";
}
........
============

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 15 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Oliver | last post by:
I'd like the email produced by FormMail to show a specific From: address rather than postmaster@server.host.name Googling isn't helping me... not sure what to look for :-( -- * John Oliver ...
4
by: LinuxNT | last post by:
Good mornin' colleagues! I have a problem with a javascript code. I attempt to program a mini application with javascript. This application is part of a frameset. I select three fields in this...
1
by: Lars Netzel | last post by:
I have an aspx page that contains a usercontrol as header on all pages. That usercontrol has a few linkbuttons... sometimes when I press either of them I get this message in the top of the screen...
13
by: Noa | last post by:
Hi I have a page that looks like that: <form name="kuku1" action ="anotherpage.html" > <input name="name"> <input name="kuku2"> </form> As far as i know, "getAttribute" should return a...
13
by: kurtj | last post by:
Hello Gurus: I have a validation script (below) that is somehow messed up. If the Name field is blank, I get the alert message, then the browser window goes to a blank document with the word...
3
by: rkhurana | last post by:
Hi I am writing a JSF application that uses some third party charts. While I can see the chart but the javascript that is supposed to calla function to update chart periodically has a problem. It...
5
by: pilsdumps | last post by:
I have a parent and child class: parent: #!/usr/local/bin/perl -w #class clFormMaker package clFormMaker; sub new { #constructor
0
by: daryl | last post by:
<code> <body> <h1>Reverse String</h1><hr /> <?php $ReverseString = $_GET; if (!isset($_GET)) echo "<p>Enter the string you want to reverse.</p>"; else{ $ForwardString = $$_GET; ...
6
by: daryl | last post by:
Howdy, just wondering if someone can help me get this form working. Everything is right, I think, except for the autoglobal. <body> <h1>Reverse String</h1><hr /> <?php $ReverseString =...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.