Link to home
Start Free TrialLog in
Avatar of No1Coder
No1CoderFlag for United States of America

asked on

Help with Ajax update panel

I have a form with a clock on it using update panel (below).  The clock updated every second.
Outside of the update panel, there is a text box.  When a user types data in the text box, the text box changed event fires every second when the clock ticks.  How can I suppress this?



                <div style="background-color:transparent;">
                    <asp:UpdatePanel runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional" ID="UpdatePanel1">
                        <ContentTemplate>
                            <asp:Label runat="server"  ID="LabelClock" Width="80px" ViewStateMode="Disabled" />
                            <asp:TextBox ID="TextBoxClock" CssClass="EntryFieldProtected" runat="server" Width="80px" ReadOnly="True" ViewStateMode="Disabled"></asp:TextBox>
                            <asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick" Interval="1000" ViewStateMode="Disabled" />
                            <asp:textbox id="TextBoxLog"  TextMode="MultiLine"      tabIndex="10" runat="server" CssClass="EntryFieldProtected" Width="326px" Height="152px" ReadOnly="True" ></asp:textbox>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
                        </Triggers>
                    </asp:UpdatePanel>
                </div>
Avatar of Johny Bravo
Johny Bravo

Easy way would be to put the textbox in other updatepanel and set its updatemode=conditional
Avatar of No1Coder

ASKER

I tried this but didn't make a difference.  Both update panels are conditional.
Avatar of Manoj Patil
Hey just try with this
ViewStateMode="Enabled" for TextBox and Timer Control
Changing viewstate makes no difference.  Already tried this.

I put the text boxes into a separate update panel (below).  As soon as I type into either one, the text changed event fires every time the timer event fires.  So, my problem still exists.


           <asp:UpdatePanel runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional" ID="UpdatePanel2">
                  <ContentTemplate>
                      <table cellpadding="0" cellspacing="0">
                        <tr>
                            <td >
                                <asp:TextBox id="TextBoxUser" runat="server" CssClass="EntryField" MaxLength="128" TabIndex="10" TextMode="Password" Visible="true" Width="195px" ToolTip="Enter your TrackStar User ID in this field to identify yourself." OnTextChanged="TextBoxUser_TextChanged"></asp:TextBox>
                            </td>
                            <td align="right">
                                <asp:label id="LabelPassword" runat="server">Password</asp:label>
                            </td>
                            <td>
                                <asp:textbox id="TextBoxPassword" tabIndex="10" runat="server" CssClass="EntryField" Width="140px"            TextMode="Password" MaxLength="16" Visible="True" AutoPostBack="True" OnTextChanged="TextBoxPassword_TextChanged" ToolTip="Enter your TrackStar password in this field to log on to the Kiosk."></asp:textbox>
                                <asp:LinkButton id="LinkButtonAction" runat="server" OnClick="LinkButtonSignIn_Click">OK</asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
You mean you are having two different update panel. In one update panel you are having textboxes and in second update panel you are having label and timer. Both the updatepanel are set as conditional?

Check if this is in master page and it contains update panel for your contenttemplate.
ASKER CERTIFIED SOLUTION
Avatar of No1Coder
No1Coder
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Nothing else worked.