Solved

AJAX trigger not running when placed inside TabControl

Posted on 2008-10-31
2
539 Views
Last Modified: 2011-09-20
Hi,

I have an AJAX Content panel with a gridview inside.  A trigger to update the filter for this is the text change property of a text box that is outside the content panel.  Works fine

However, I want to use the AJAX TabControl, and when the textbox changes nothing happens

To start off with, I kept the text box outside the tabcontrol and the update panel, but I had an error message saying that my textbox could not be found

So I moved the textbox to inside the content panel, now nothing happens except for a beep.

I've attached the code as it currently is.  Is there a way to get this content panel to update inside a TabControl?
<ajaxToolkit:ToolkitScriptManager runat="server" ID="ScriptManager1" />
    <ajaxToolkit:TabContainer runat="server" ID="Tabs">
        <ajaxToolkit:TabPanel runat="server" ID="tbAdd" HeaderText="View Current Records">
            <ContentTemplate>
                <asp:Panel ID="pnlCurData" runat="server">
                    <asp:UpdatePanel ID="uplData" runat="server">
                        <ContentTemplate>
                            Filter Telephone:<asp:TextBox ID="txtTelephone" runat="server"></asp:TextBox><br />
                            <asp:ObjectDataSource ID="odsData" runat="server" OldValuesParameterFormatString="original_{0}"
                                SelectMethod="GetData" InsertMethod="AddData" TypeName="Data999Mgr">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="txtTelephone" Name="telNumber" PropertyName="Text"
                                        Type="String" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                AllowSorting="true" DataSourceID="odsData" CellPadding="4" ForeColor="#333333"
                                GridLines="None">
                                <Columns>
                                   <!--loads of columns here-->
                                </Columns>
                            </asp:GridView>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="pnlCurData$txtTelephone" EventName="TextChanged" />
                        </Triggers>
                    </asp:UpdatePanel>
                </asp:Panel>
            </ContentTemplate>
        </ajaxToolkit:TabPanel>

Open in new window

0
Comment
Question by:krapvag
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
Juan_Barrera earned 125 total points
ID: 22855852
Hi,
I've tried your code and the TextChanged event was not firing because the TextBox didn't have its AutoPostBack property enabled.
After setting it to true, the event fires and the update panel refreshes. Here is a short demo sample:
 

        <AjaxToolkit:TabContainer runat="server" ID="Tabs">
            <AjaxToolkit:TabPanel runat="server" ID="tbAdd" HeaderText="View Current Records">
                <ContentTemplate>
                    <asp:Panel ID="pnlCurData" runat="server">
                        <asp:UpdatePanel ID="uplData" runat="server">
                            <ContentTemplate>
                                Filter Telephone:<asp:TextBox ID="txtTelephone" runat="server" AutoPostBack="true"></asp:TextBox><br />
                                <asp:Label runat="server" ID="text1"></asp:Label>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="txtTelephone" EventName="TextChanged" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </asp:Panel>
                </ContentTemplate>
            </AjaxToolkit:TabPanel>
        </AjaxToolkit:TabContainer>
---------------------------------------------------------------
 
 Protected Sub txtTelephone_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtTelephone.TextChanged
        text1.Text = txtTelephone.Text
    End Sub

Open in new window

0
 
LVL 1

Author Closing Comment

by:krapvag
ID: 31512125
Thank you, that has fixed it
0

Featured Post

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question