Я использую ajax toolkit asyncFileUpload control
У меня была проблема с тем, что мои события на стороне сервера не запускаются, и обнаружил эти сообщения Скрытый / показанный элемент управления AsyncFileUpload не запускает событие UploadedComplete на стороне сервера
Я вставил свой загрузчик внутри формы и с этими атрибутами 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>