Gridview上的AsyncPostback触发器

时间:2016-04-15 10:35:39

标签: c# asp.net gridview partial-postback

我正在处理AsyncPostback触发器,当我输入url

时它工作正常
  

本地主机:49208 / Default.aspx的

但是当我从url事件处理程序中删除default.aspx时没有调用。 这是我的代码

<asp:UpdatePanel ID="UPCompanyNews" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
            <ContentTemplate>
                <div id="ComUploaderImgDiv" class="cr-lodr" runat="server">
                    <asp:Image ID="ComUploaderImg" runat="server" ImageUrl="~/Images/busy.gif" />
                </div>

                <div id="ComCarouselDiv" style="background-color: #FFFFFF;" runat="server">
                    <carousel:CompanyNews ID="CarouselCompanyNews" runat="server" EnableViewState="true" />

                </div>

            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="hiddenComNewsAsyTrigger" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
        <asp:Button ID="hiddenComNewsAsyTrigger" runat="server" Text="AsyncUpdate" Style="display: none;" OnClick="LoadCompanyCarouselTrigger" />

事件处理程序代码

protected void LoadCompanyCarouselTrigger(object sender, EventArgs e)
    {
        try
        {
            CarouselCompanyNews.LoadCompanyNewsCarousel();
            ComUploaderImgDiv.Style["display"] = "none";
            ComCarouselDiv.Style["display"] = "block";
            LoadClientActivityTrigger();
            LoadMyStatTrigger(sender, e);
            LoadEventTrigger(sender, e);

        }
        catch (Exception ex)
        {

            throw ex;
        }
    }

0 个答案:

没有答案