|
|
|
start date: Tue, 14 Aug 2007 15:26:05 -0700,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
Alex Maghen am
|
|
2
Sergey Poberezovskiy
|
|
3
(Steven Cheng[MSFT])
|
enctype="multipart/form-data" for MasterPage
I have a MasterPage. The MasterPage actually contains the <form> tag which is
used throughout the site.
On just certain pages that use that MasterPage, I need the "enctype" for the
<form> tag 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
Date:Tue, 14 Aug 2007 15:26:05 -0700
Author:
|
RE: enctype="multipart/form-data" for MasterPage
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 <form> tag which is
> used throughout the site.
>
> On just certain pages that use that MasterPage, I need the "enctype" for the
> <form> tag 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
Date:Tue, 14 Aug 2007 18:18:01 -0700
Author:
|
RE: enctype="multipart/form-data" for MasterPage
Hi Alex,
As Sergey has suggested, you can use code to programmatically set the
attributes of <form> tag. 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.
Date:Wed, 15 Aug 2007 06:31:51 GMT
Author:
|
|
|