Any help would be greatly appreciated.
I have an ascx file which contains a datagrid containing:
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button1" runat="server" CommandName = "UploadFile" Text="Submit File" />
This ascx file is loaded into an aspx file. The aspx file contains this line:
<form id="frm" name="frm" action="PageLoader.aspx?page_id=<%=pageId%>" method=post enctype="multipart/form-data" runat="server">
The action calls the pageid.ascx which is the file with my Fileupload. The page loads and I can upload files. However, the aspx file contains menus which link to other pages. When I click on any menu I receive the error message: fatal error field type file is not supported for this function.
How can I correct this? Why am I receiving this error? The error message repeats itself about 50 times until the page requested loads itself!
asp.net uses the <form> tag to handle its postbacks, im not sure if you can actually do this...
Please explain. Do you mean that I cannot use the form tag in the aspx file so that it will handle the uploading of the file from the ascx file? If I put the form tag in the ascx file the upload file input returns nothing. On the other hand, the error message no longer appears...
How can I upload the file AND not receive an error message using the scenario of having the ascx file loaded onto the aspx file?
We cannot change the action of form which contains "runat=server". It posts to itself by default.
In your case, if we want to post to another page, we can use server.transfer or response.redirect method.
If we want to post data to another website, we can use HttpWebResponse and HttpWebRequest class.
I look forward to hearing from you.
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.