2 Replies - 788 Views - Last Post: 08 February 2012 - 04:00 PM Rate Topic: -----

Topic Sponsor:

#1 Serendipitus  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 21
  • Joined: 07-December 10

AJAX trigger not firing after first call

Posted 06 February 2012 - 04:02 PM

Hello,

I am developing a web app that allows a user to browse a datatable. I have an ajax updatepanel set up to only load the appropriate rows based on a value from a combobox. The code follows
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always" >
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="websiteComboBox" EventName="SelectedIndexChanged" />
            </Triggers>
            <ContentTemplate>
                    <asp:TabContainer ID="TabContainer1" runat="server" 
        ActiveTabIndex="2">
                        <asp:TabPanel runat="server" HeaderText="All" ID="TabPanel1" >
                            <ContentTemplate>
                                <div class="TabContent">
                                    <asp:GridView ID="AllGridView" CssClass="GridView" runat="server" 
                                        CellPadding="4" ForeColor="#333333" GridLines="None" 
                                        ShowHeaderWhenEmpty="True" AutoGenerateColumns="True" RowStyle-Wrap="False" Font-Size="X-Small">
                                        ...
                </ContentTemplate>
            </asp:UpdatePanel>


When the page first loads and I select an option from the combobox, the gridview updates appropriately. However, when a change the combobox value the gridview does not update. The SelectedIndexChanged event does not even fire. It works fine without the ajax but there is a lot of information being loaded so narrowing down specific elements requested is essential. Any help will be much appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: AJAX trigger not firing after first call

#2 ajwsurfer  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 373
  • Joined: 24-October 06

Re: AJAX trigger not firing after first call

Posted 08 February 2012 - 10:44 AM

I would first change the line:
 <asp:AsyncPostBackTrigger ControlID="websiteComboBox" EventName="SelectedIndexChanged" />

to
 <asp:AsyncPostBackTrigger ControlID="websiteComboBox" />

Then I would set the break point in the Page_Load() function and run the debugger (hit the green triangle). When the page first loads we know that works, so just hit the green button again for the first page load. Then change the Index in the "websiteComboBox" and step through the code. My guess is that the "websiteComboBox" is not triggering the update panel. That will need to be addressed first.
Was This Post Helpful? 0
  • +
  • -

#3 Serendipitus  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 21
  • Joined: 07-December 10

Re: AJAX trigger not firing after first call

Posted 08 February 2012 - 04:00 PM

The problem is that the code does not even enter the event handler for the combobox after the first change. If more information is need let me know.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1