我使用Ajax工具包asyncFileUpload控制如何使用形式方法=「郵報」在asp.net web表單
我有我的服務器端事件不解僱的問題,發現這個帖子Hidden/Shown AsyncFileUpload Control Doesn't Fire Server-Side UploadedComplete Event
我插入我的上傳內部形狀以及與此屬性enctype="multipart/form-data" method="post"
這上傳是我的網形式,其爲母版頁
裏面添加這個屬性,我得到這個錯誤後內
A page can have only one server-side Form tag.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: A page can have only one server-side Form tag.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
這裏是我的網頁形式
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<form id="Form1" enctype="multipart/form-data" method="post" action="target_url"
runat="server">
<div id="Div1" runat="server">
Just some time to make sure that the page doesn't get reloaded after uploading:
<%=DateTime.Now %><br />
<ajaxToolkit:AsyncFileUpload ID="FileUpload" runat="server" OnUploadedComplete="FileUpload_UploadCompleted"
OnClientUploadComplete="FileUpload_ClientUploadCompleted" OnClientUploadError="uploadError"
OnLoad="FileUpload_OnLoad" />
<asp:Image runat="server" ID="imgUpload" src="" />
<asp:Label runat="server" ID="lblerror" Text="" />
</div>
</form>
</asp:Content>
這是ASP .NET WebForms **吸引**的主要原因之一。 – Yuck 2012-02-17 15:18:14
:D有沒有解決方案? – 2012-02-17 15:21:35
切換到MVC :) – xandercoded 2012-02-17 15:22:04