Timer unexpectedly affects other controls on the page.

Last post 05-09-2008 8:57 PM by albertpascual. 1 replies.

Sort Posts:

  • Timer unexpectedly affects other controls on the page.

    05-09-2008, 6:34 PM
    • Loading...
    • mauroregio
    • Joined on 05-09-2008, 10:11 PM
    • Posts 1

    Hi,

    I have a ASP page in which a Timer updates an UpdatePanel every X seconds. The panel contains a UserCtrl that shows Weather Conditions.

    In that same page, I also have another UserCtrl implementing something similar to a search box (Input Text Box and Submit Button).
    The form implementing the search box, has an updated panel (not attached to the timer) and an updateprogress,
    to show users some feedback while waiting for the search to complete.

    When the timer ticks I get a postback on the UserCtrl implementing the search box.

    I have spent some time playing with UpdateMode for every panel involved and Triggers for the Weather Panel, but without making progress.

    Any help would be really appreciated :-)

    Here are some snippets for reference (mind I removed some stuff to make it short enough for the post)

    Main Page (EZC:LS is the UserCtrl implemeting the search box)

    <asp:Content ID="myMainColumn" ContentPlaceHolderID="MainColumn" runat="server">
    <asp:Timer ID="WeatTimer" runat="server" Interval="20000" />
    <div id="maintopics">
    <div class="core_topic">
    <h2>.....</h2>
    <p>......</p>

    <EZC:LS ID="mySBox" runat="server" />  
     

    <br />
    <div id="featuretopics">
    <div class="feature_topic">
    <h3>Local Weather</h3>
     

    <asp:UpdatePanel ID="UpdPaWea" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
    <ContentTemplate>
    <EZC:Wea ID="WeaRotWA" runat="server" WeaParam="Current" LocationNames="...."/>
    </ContentTemplate>
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="WeatTimer" />
    </Triggers>
    </asp:UpdatePanel>
     

    </div>
    </div>
    </asp:Content>

    This is the markup for the Search box

    <asp:UpdatePanel ID="LocSearchUpd" runat="server" RenderMode="Block" UpdateMode="Conditional" ChildrenAsTriggers="false">
    <ContentTemplate>
    <div id="LocSearch">
    <fieldset>
    <legend>
    <span>Search Location</span>
    </legend>
    <ol>
    <li>
    <asp:Label ID="Lbl" AssociatedControlID="SearchTextBox" runat="server" Text="Name:"/>
    <asp:TextBox ID="SearchTextBox" runat="server" EnableViewState="False" />
    <asp:RegularExpressionValidator ID="SearchTextValidator" ControlToValidate="SearchTextBox" runat="server"
    ErrorMessage="Please enter location search in format..."
    ValidationExpression="..." />
    <ACT:TextBoxWatermarkExtender ID="SBWE" runat="server" TargetControlID="SearchTextBox" WatermarkText="..." WatermarkCssClass="SBWM" />
    </li>
    </ol>
    </fieldset>
    <fieldset class="submit">
    <EZ:RolloverButton ID="SearchBtn" runat="server" Text="Go" onclick="SearchBtn_Click" CausesValidation="true"/>
    </fieldset>


    <asp:UpdateProgress ID="LocSearchUpdPro" runat="server" AssociatedUpdatePanelID="LocSearchUpd">
    <ProgressTemplate>
    <asp:Image ID="LSUPImg" runat="server" ImageUrl="~/images/anim/Pro01.gif"/>
    Searching for locations...
    </ProgressTemplate>
    </asp:UpdateProgress>
    </div> 
     

    </ContentTemplate>
    </
    asp:UpdatePanel>

     

     

     

  • Re: Timer unexpectedly affects other controls on the page.

    05-09-2008, 8:57 PM

     

    Put the timer inside the update panel.
    Cheers
    Al
    My Blog
    Follow me
    Please click on 'Mark as Answer' if this post answered your question!
Page 1 of 1 (2 items)