Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net LinkButton OnClick在更新面板中不是Frie_Asp.net_Ajax_Asp.net Ajax - Fatal编程技术网

Asp.net LinkButton OnClick在更新面板中不是Frie

Asp.net LinkButton OnClick在更新面板中不是Frie,asp.net,ajax,asp.net-ajax,Asp.net,Ajax,Asp.net Ajax,LinkButton OnClick(LoadDocumentVersion)在更新面板中不是Frie这里是我在aspx页面中的代码,我尝试使用UpdateMode=“Conditional”它不是fire,也使用了asyncpostback它不是fire <pre>LinkButton OnClick(LoadDocumentVersion) is Not Frie inside Update panal </pre> <asp:Upd

LinkButton OnClick(LoadDocumentVersion)在更新面板中不是Frie这里是我在aspx页面中的代码,我尝试使用UpdateMode=“Conditional”它不是fire,也使用了asyncpostback它不是fire

<pre>LinkButton OnClick(LoadDocumentVersion) is Not Frie inside Update panal
    </pre>

         <asp:UpdatePanel ID="Aspx_UpdatePanel_DocumentVersion" UpdateMode="Conditional" runat="server">

                                                            <ContentTemplate>
                                                                <asp:LinkButton ID="Aspx_LinkButton_DocumentVersion" runat="server" Style="float: right; margin: 2px 5px 2px 0;"  CssClass="Label_Text9"
                                                                    OnClick="LoadDocumentVersion" />
                                                                <asp:UpdateProgress runat="server" AssociatedUpdatePanelID="Aspx_UpdatePanel_DocumentVersion"
                                                                    DynamicLayout="true">
                                                                    <ProgressTemplate>
                                                                        <img src="Images/loading.gif" />
                                                                    </ProgressTemplate>
                                                                </asp:UpdateProgress>

                                                                <table border="0" width="100%" cellpadding="0" cellspacing="0" align="center" style="float: left;">
                                                                    <tr valign="top">
                                                                        <td style="padding: 5px;" align="center">

                                                                            <asp:Repeater ID="Aspx_Repeater_DocumentVersions" runat="server">
                                                                                <HeaderTemplate>
                                                                                    <table border="0" width="100%" cellpadding="0" cellspacing="0" align="center">
                                                                                        <tr valign="top" align="left" class="border_spacing">
                                                                                            <td class="Heading_border_left_spacing">
                                                                                                <asp:Label ID="Label1" runat="server" CssClass="Label_Text12_Bold" Text="<%$Resources:CRMDocument, Lbl_Attachments_FileName %>" />
                                                                                            </td>
                                                                                            <td class="Heading_border_withoutspacing">
                                                                                                <asp:Label ID="Label2" runat="server" CssClass="Label_Text12_Bold" Text="<%$Resources:CRMDocument, Lbl_Attachments_Type %>" />
                                                                                            </td>
                                                                                            <td class="Heading_border_withoutspacing">
                                                                                                <asp:Label ID="Label3" runat="server" CssClass="Label_Text12_Bold" Text="<%$Resources:CRMDocument, Lbl_Attachments_Size %>" />
                                                                                            </td>
                                                                                            <td class="Heading_border_right_spacing">
                                                                                                <asp:Label ID="Label4" runat="server" CssClass="Label_Text12_Bold" Text="<%$Resources:CRMDocument, Lbl_Attachments_Created_By %>" />
                                                                                            </td>
                                                                                        </tr>
                                                                                </HeaderTemplate>
                                                                                <ItemTemplate>
                                                                                    <tr valign="middle" align="left" height="25px">
                                                                                        <td class="border_left_spacing">
                                                                                            <a class="Anchor_Text9_Grey" href="DownloadAttachment.aspx?InternalPath=<%#( (System.Data.DataRowView)(Container.DataItem)).Row["InternalPath"].ToString () %>&amp;InternalFileName=<%#( (System.Data.DataRowView)(Container.DataItem)).Row["InternalFileName"].ToString () %>&amp;ExternalFileName=<%#( (System.Data.DataRowView)(Container.DataItem)).Row["ExternalFileName"].ToString () %>"
                                                                                                onclick='javascript:SafeHandleURL(this, "DownloadAttachment.aspx", "<%#( (System.Data.DataRowView)(Container.DataItem)).Row["InternalPath"].ToString ().Replace ( @"\", @"\\" ) %>", "<%#( (System.Data.DataRowView)(Container.DataItem)).Row["InternalFileName"].ToString () %>", "<%#( (System.Data.DataRowView)(Container.DataItem)).Row["ExternalFileName"].ToString () %>" );'>
                                                                                                <asp:Label ID="Label5" runat="server" Text='<%#( (System.Data.DataRowView)(Container.DataItem)).Row["ExternalFileName"].ToString () %>'
                                                                                                    CssClass="Label_Text9" />&#160; </a>
                                                                                        </td>
                                                                                        <td class="border_withoutspacing">
                                                                                            <asp:Label ID="Label6" runat="server" CssClass="Label_Text9" Text='<%#( (System.Data.DataRowView)(Container.DataItem)).Row["Type"].ToString () %>' />&#160;
                                                                                        </td>
                                                                                        <td class="border_withoutspacing Label_Text9">
                                                                                            <asp:Label ID="Label7" runat="server" CssClass="Label_Text9" Text='<%#( (System.Data.DataRowView)(Container.DataItem)).Row["FileSize"].ToString () %>' />&#160;
                                                                                            <asp:Label ID="Label8" runat="server" CssClass="Label_Text12_Bold" Text="<%$Resources:CRMDocument, Lbl_Attachments_Bytes %>" />&#160;
                                                                                        </td>
                                                                                        <td class="border_right_spacing">
                                                                                            <asp:LinkButton ID="LinkButton1" runat="server" Text='<%#( (System.Data.DataRowView)(Container.DataItem)).Row["CreatedBy"].ToString () %>'
                                                                                                CssClass="Label_Text9" CommandArgument='<%#( (System.Data.DataRowView)(Container.DataItem)).Row["CreatedByID"].ToString () %>'
                                                                                                OnCommand="GoToEmployee" />&#160;
                                                                                        </td>
                                                                                    </tr>
                                                                                </ItemTemplate>
                                                                                <FooterTemplate>
                                                                                    <tr height="10px">
                                                                                        <td colspan="3" />
                                                                                    </tr>
                                                                                    </table>
                                                                                </FooterTemplate>
                                                                            </asp:Repeater>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </ContentTemplate>

                                                        </asp:UpdatePanel>
  • 确保页面指令中的
    AutoEventWireup=“true”

  • 确保您没有收到错误,无论是客户端还是服务器端。附加调试器并逐步检查代码以确保

  • 您的按钮无法按原样单击,因为它是不可见的,所以我假设您通过JavaScript调用单击。要对链接按钮执行此操作,需要评估其href属性:
    eval(document.getElementById(“”.getAttribute(“href”)

  • 确保所有webresource请求都通过(即200或300s状态代码)。这就是MS AJAX框架的获取方式

  • 确保脚本管理器是
    标记之后的第一个控件,并且所有后续支持AJAX的内容都在


  • 您的代码隐藏在哪里?是否已将ScriptManager控件添加到.aspx文件中?如果没有它,您的更新面板将无法工作!!!在您的更新面板前添加以下行:我添加这一行是因为我正在使用telerik,然后它也不工作
      protected void LoadDocumentVersion(object sender, EventArgs e)
            {
                try
                {
                    string zszFolderID = "";
                    string zszDocumentID = "";
                    string zszIsPublic = "";
                    EMSBLCommon.AddToLog("Document", "CRM", "View Document Versions", "");
                    string zszUpdateDocument = Aspx_HiddenField_DocumentPath.Value;
                    string zszDocumentPath = zszUpdateDocument.Substring(0, zszUpdateDocument.LastIndexOf('/'));
                    string zszDocumentName = zszUpdateDocument.Substring(zszUpdateDocument.LastIndexOf('/') + 1);
    
                    zszFolderID = GetFolderID(zszDocumentPath, ref zszIsPublic);
                    zszDocumentID = EMSBLCRM.GetDocumentID(zszFolderID, zszDocumentName).ToString();
                    if (!zszDocumentID.Equals("0"))
                        LoadDocumentAttachments(zszDocumentID);
                }
                catch (Exception ex)
                {
                    Utilities.SendCrashEMail(ref ex);
                }
            }