因此,我在ASP.NET WebForm应用程序中有一个jQuery对话框,可以将所有包含的控件的内容发布到另一个页面。问题是FileUpload控件。当EnablEventValidation设置为true,我想这是在默认情况下,我得到这个错误...当EnableEventValidation设置为'false'时,未设置Post变量
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
...如果我设置EnableEventValidation='false'
,在FileUpload
控制设置图像张贴,但所有我的其他发布值返回为空。所以我认为我要么需要禁用EventValidation
为只是FileUpload
控制,或以某种方式手动验证它。但我不知道该怎么做。我不知道为什么我的所有其他后期值应该为空,如果EnableEventValidation
设置为false。这里是我的对话框的标记......
<div class="divDialog" style="display: none">
<table style="width: 100%;">
<tr>
<td>First Name: <asp:TextBox ID="txtFirstName" runat="server" Text=""></asp:TextBox></td>
<td>Last Name: <asp:TextBox ID="txtLastName" runat="server" Text=""></asp:TextBox></td>
</tr>
<tr>
<td>
How Old are You?
<asp:DropDownList ID="ddlAge" runat="server">
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
</asp:DropDownList>
</td>
<td>
How Many Siblings do You Have?
<asp:DropDownList ID="ddlNumberSiblings" runat="server">
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
<asp:ListItem Value="4">4</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
What is your birthday?
<input type="text" id="datepicker" name="datepicker" />
</td>
</tr>
<tr>
<td>
Please Choose a Picture to Upload:
<asp:FileUpload ID="fupUserPicture" runat="server" />
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClientClick="forcebtnHiddenClick(); return false;" />
</td>
</tr>
</table>
</div>
编辑:另外,这可能有关,对话框的div被附加到一个div是在窗体中,它的创建后。这里的形式和DIV标记......
<form id="frmDialog" runat="server">
<asp:Button ID="btnDisplayDialog" runat="server" Text="Click to Display Login Dialog" OnClientClick="showDialog(); return false;" />
<div class="divInnerForm"></div>
...
</div>
<asp:Button ID="btnHidden" runat="server" Text="" Visible="false" ClientIDMode="Predictable" OnClick="btnHidden_Click"/>
..和这里的jQuery脚本...
function showDialog() {
$('.divDialog').dialog({
modal: true, show: 'slide', width: 500,
open: function (event, ui) {
$('.divInnerForm').append($(this).parent());
}
});
}
您的对话框是否在更新面板中? – gustavodidomenico 2013-05-09 18:46:45
不,它位于表单内部的div内,但它必须在创建后使用jQuery脚本附加到此div。我现在会发布该代码/标记... – MassStrike 2013-05-09 18:52:19
只有意识到,您是否尝试删除“动态”行为并观察组件响应? – gustavodidomenico 2013-05-09 19:01:21