Uploading Files

M

Michael Morse

I have built a user control that works with a knowledge
base system. This control looks in a directory related to
the particular kb article and display related files.
However since this control runs within the pages currently
existing form tag what are the repercussions to nesting
another form to handle the form for "multipart/form-data"
for uploading the files? Can you nest these forms? Do they
hinder functionality in one form or the other?

<form enctype="multipart/form-data" runat="server"
ID="Form1">
<input id="UploadFile" type="file" runat="server"
NAME="UploadFile">
<asp:Button id="Button1" runat="server"
Text="Upload"></asp:Button>
</form>
 
L

Lewis Wang [MSFT]

Hi Michael,

Thanks for your posting. I am checking this issue, and will get back to you
with my findings.

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Michael Morse" <[email protected]>
| Sender: "Michael Morse" <[email protected]>
| Subject: Uploading Files
| Date: Tue, 19 Aug 2003 07:33:04 -0700
| Lines: 16
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcNmXsywlXGS+cG1QpCCt1oNhV+Gkw==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:14028
| NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| I have built a user control that works with a knowledge
| base system. This control looks in a directory related to
| the particular kb article and display related files.
| However since this control runs within the pages currently
| existing form tag what are the repercussions to nesting
| another form to handle the form for "multipart/form-data"
| for uploading the files? Can you nest these forms? Do they
| hinder functionality in one form or the other?
|
| <form enctype="multipart/form-data" runat="server"
| ID="Form1">
| <input id="UploadFile" type="file" runat="server"
| NAME="UploadFile">
| <asp:Button id="Button1" runat="server"
| Text="Upload"></asp:Button>
| </form>
|
 
L

Lewis Wang [MSFT]

Hi Michael,

Do you want to put a user control, which contains a server side form tag,
to Web Form page? Pease correct me if I misunderstand the issue.

A server side form tag cannot contain another server side form tag. If we
try to put the user control to the web form, we will get an "A page can
have only one server-side Form tag" Error.

You may try to remove the for tag from the user control and add
"enctype=multipart/form-data" to the web page's form tag .

Please let me know if it works, thanks.

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Michael Morse" <[email protected]>
| Sender: "Michael Morse" <[email protected]>
| Subject: Uploading Files
| Date: Tue, 19 Aug 2003 07:33:04 -0700
| Lines: 16
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcNmXsywlXGS+cG1QpCCt1oNhV+Gkw==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:14028
| NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| I have built a user control that works with a knowledge
| base system. This control looks in a directory related to
| the particular kb article and display related files.
| However since this control runs within the pages currently
| existing form tag what are the repercussions to nesting
| another form to handle the form for "multipart/form-data"
| for uploading the files? Can you nest these forms? Do they
| hinder functionality in one form or the other?
|
| <form enctype="multipart/form-data" runat="server"
| ID="Form1">
| <input id="UploadFile" type="file" runat="server"
| NAME="UploadFile">
| <asp:Button id="Button1" runat="server"
| Text="Upload"></asp:Button>
| </form>
|
 
M

Michael Morse

Yeah that works but then it makes managing your page forms
more cumbersome. What I've done for now is when the user
clicks upload a new window pops that contains the correct
form attributes and functionality. Thanks for the help!

-mike
 
L

Lewis Wang [MSFT]

Hi Michael,

I am glad to hear that. Thank you for sharing the knowledge in the
newsgroup.

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Michael Morse" <[email protected]>
| Sender: "Michael Morse" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: RE: Uploading Files
| Date: Wed, 20 Aug 2003 07:39:22 -0700
| Lines: 81
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNnKNhTeya5CcGJSWyCKWpJJYsZiA==
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:14060
| NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Yeah that works but then it makes managing your page forms
| more cumbersome. What I've done for now is when the user
| clicks upload a new window pops that contains the correct
| form attributes and functionality. Thanks for the help!
|
| -mike
|
| >-----Original Message-----
| >Hi Michael,
| >
| >Do you want to put a user control, which contains a
| server side form tag,
| >to Web Form page? Pease correct me if I misunderstand the
| issue.
| >
| >A server side form tag cannot contain another server side
| form tag. If we
| >try to put the user control to the web form, we will get
| an "A page can
| >have only one server-side Form tag" Error.
| >
| >You may try to remove the for tag from the user control
| and add
| >"enctype=multipart/form-data" to the web page's form tag .
| >
| >Please let me know if it works, thanks.
| >
| >Best regards,
| >Lewis
| >
| >This posting is provided "AS IS" with no warranties, and
| confers no rights.
| >
| >--------------------
| >| Content-Class: urn:content-classes:message
| >| From: "Michael Morse" <[email protected]>
| >| Sender: "Michael Morse" <[email protected]>
| >| Subject: Uploading Files
| >| Date: Tue, 19 Aug 2003 07:33:04 -0700
| >| Lines: 16
| >| Message-ID: <[email protected]>
| >| MIME-Version: 1.0
| >| Content-Type: text/plain;
| >| charset="iso-8859-1"
| >| Content-Transfer-Encoding: 7bit
| >| X-Newsreader: Microsoft CDO for Windows 2000
| >| Thread-Index: AcNmXsywlXGS+cG1QpCCt1oNhV+Gkw==
| >| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| >| Newsgroups:
| microsoft.public.dotnet.framework.aspnet.webcontrols
| >| Path: cpmsftngxa06.phx.gbl
| >| Xref: cpmsftngxa06.phx.gbl
| >microsoft.public.dotnet.framework.aspnet.webcontrols:14028
| >| NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
| >| X-Tomcat-NG:
| microsoft.public.dotnet.framework.aspnet.webcontrols
| >|
| >| I have built a user control that works with a knowledge
| >| base system. This control looks in a directory related
| to
| >| the particular kb article and display related files.
| >| However since this control runs within the pages
| currently
| >| existing form tag what are the repercussions to nesting
| >| another form to handle the form for "multipart/form-
| data"
| >| for uploading the files? Can you nest these forms? Do
| they
| >| hinder functionality in one form or the other?
| >|
| >| <form enctype="multipart/form-data" runat="server"
| >| ID="Form1">
| >| <input id="UploadFile" type="file" runat="server"
| >| NAME="UploadFile">
| >| <asp:Button id="Button1" runat="server"
| >| Text="Upload"></asp:Button>
| >| </form>
| >|
| >
| >.
| >
|
 

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

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,172
Latest member
NFTPRrAgenncy
Top