当我单击 RadioButton 时,我需要进行回发,以便它可以运行我的 RadioButton 代码。(AutoPostback="true")。我在 jQuery UI 对话框中有我的单选按钮,当我单击该按钮时没有任何反应,并且出现错误:
未捕获的 Sys.WebForms.PageRequestManagerServerErrorException:Sys.WebForms.PageRequestManagerServerErrorException:处理服务器上的请求时发生未知错误。服务器返回的状态码是:404
我读到一些对话框实际上将自己置于表单之外?我将此添加到我的 Javascript 函数中以防止它:
function getFiles(canDo) {
//create Popup with content from div
$('#file').dialog({//file is the div where my controls are
autoOpen: true,
height: 'auto',
width: 'auto',
modal: true,
buttons: {
"Ok": function () {
debugger;
},
Cancel: function () {
$(this).dialog('close');
}
}
});
$('#file').appendTo($("form:first"));
}
关于为什么它不会成功回发的任何想法?或者为什么我得到那个错误?
我的控制:
<ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
<ContentTemplate>
<div id="casefiles">
<%--<div id="rbfileByHolder" runat="server">--%>
<label>
Sort By</label>
<span>
<asp:RadioButton class="aspRBs" GroupName="rbfileByNameOrID" ID="rbMyFiles" Text="My Files"
Checked="true" runat="server" AutoPostBack="True" OnCheckedChanged="rbMyFiles_CheckedChanged" /></span>
<span>
<asp:RadioButton class="aspRBs" GroupName="rbfileByNameOrID" ID="rbByFileID" Text="By File ID"
runat="server" AutoPostBack="True" OnCheckedChanged="rbByFileID_CheckedChanged" /></span>
<span>
<asp:RadioButton class="aspRBs" GroupName="rbfileByNameOrID" ID="rbByFileName" Text="By File Name"
runat="server" AutoPostBack="True" OnCheckedChanged="rbByFileName_CheckedChanged" /></span>
<%-- </div>--%>
<br />
<label>
Select New CaseFile</label>
<asp:DropDownList runat="server" ID="ddlCaseFiles" DataSourceID="dsMyCaseFiles" DataTextField="Display"
DataValueField="FileID" OnPreRender="ddl_PreRender" Width="524px"
/>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlCaseFiles"
ToolTip="Casefile Required" InitialValue="-1" Text="*" Display="Dynamic" />
<ajaxToolkit:ListSearchExtender ID="ddlExtCaseFiles" runat="server" PromptCssClass="ListSearchExtenderPrompt"
TargetControlID="ddlCaseFiles" BehaviorID="ddlExtCaseFiles" Enabled="True" />
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="rbByFileName" EventName="CheckedChanged" />
<asp:AsyncPostBackTrigger ControlID="rbByFileID" EventName="CheckedChanged" />
<asp:AsyncPostBackTrigger ControlID="rbMyFiles" EventName="CheckedChanged" />
</Triggers>
</asp:UpdatePanel>
<%--<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
</ContentTemplate>
</asp:UpdatePanel>--%>
<asp:SqlDataSource ID="dsCaseFiles" runat="server" ConnectionString="<%$ ConnectionStrings:OSCIDConnectionString %>" ProviderName="System.Data.SqlClient" SelectCommand="p_CaseFiles_ListActiveCaseFiles" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:SessionParameter Name="InvestigatorID" SessionField="InvestigatorID" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="dsCaseFilesReverse" runat="server" ConnectionString="<%$ ConnectionStrings:OSCIDConnectionString %>" ProviderName="System.Data.SqlClient" SelectCommand="p_CaseFiles_ListActiveCaseFilesReverse" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:SessionParameter Name="InvestigatorID" SessionField="InvestigatorID" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="dsMyCaseFiles" runat="server" ConnectionString="<%$ ConnectionStrings:OSCIDConnectionString %>" ProviderName="System.Data.SqlClient" SelectCommand="p_CaseFiles_ListActiveCaseFilesAssignedTo" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:SessionParameter Name="InvestigatorID" SessionField="InvestigatorID" />
<asp:SessionParameter Name="AssignedTo" SessionField="InvestigatorID" />
</SelectParameters>
</asp:SqlDataSource>
</form>