jQuery UI对话框不会让我做AutoPostback

时间:2012-10-02 18:37:22

标签: javascript jquery asp.net jquery-ui-dialog

当我点击RadioButton时,我需要进行回发,以便它可以运行我的RadioButton代码。(AutoPostback =“true”)。我在jQuery UI对话框中有我的单选按钮,当我点击按钮时没有任何反应,我收到错误:

  

Uncaught 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>

0 个答案:

没有答案