Click here to Skip to main content
15,880,972 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I hope you can help.
I have an update panel which contains a gridview.

In the template row I have a textbox and OnTextChanged in the textbox I handle updating the database in code-behind. Sometimes this takes a moment.
I would like the UpdatePanelAnimation to fade out and then fade in so use knows that this is happening.
If I add a button to the update panel and click it, then this happens.

However with the textbox set to "autopostback=true" but data updates and the panel refrehes but the updatepanelanimation does not occur.

So how can i cause the updatepanelanimation to run when textbox.textchanged is running ?

I have tried manually registering the GridView textboxes on row.databound, but this makes no difference ( SM1 is scriptmanager1).

C#
if (SM1 !=null)
           {
           TextBox JNTB = (TextBox)e.Row.FindControl("JobNotesTB");
           if (JNTB != null)
           {
               SM1.RegisterAsyncPostBackControl(JNTB);
           }
           }


here is the aspx snippet

ASP.NET
<asp:UpdatePanel ID="UP1" runat="server" >
      
        <ContentTemplate>
            
      <asp:Label ID="Bay1Label" runat="server"  Text="Bay 1" CssClass="BayLabelStyle"></asp:Label>
             <asp:Button ID="UP1but" runat="server" Text="Update" OnClick="btn_Click" />
                    <asp:GridView ID="GV1" runat="server" width="100%" CssClass="Grid" AlternatingRowStyle-BackColor="Azure" AutoGenerateColumns="False" OnRowEditing="GVRowEdit" OnRowDataBound="GVRowDataBound"  AllowSorting="True" OnRowUpdating="GVRowUpdate" OnRowCancelingEdit="GVRowCancellingEdit"  >
        <Columns>
       
<asp:TemplateField HeaderText="Jobs / Notes"  ItemStyle-HorizontalAlign="Center" HeaderStyle-CssClass="JobNotesCol">
                <EditItemTemplate>
                             <asp:TextBox  ID="JobNotesEditTB" runat="server" Text='<%# Bind("JobNotes") %>'  TextMode="MultiLine" Height="98%" Width="98%" class="expand" ></asp:TextBox>
                </EditItemTemplate>
                 <ItemTemplate>
                            <asp:TextBox ID="JobNotesTB"  runat="server" Text='<%# Bind("JobNotes") %>' OnTextChanged="TB_TextChanged" onchange="return: FadeGV();" TextMode="MultiLine"  style="height:98%; width:98%;" class="expand" AutoPostBack="True" CssClass="expand"></asp:TextBox> 
                </ItemTemplate>
            </asp:TemplateField> 
</ContentTemplate>
</asp:UpdatePanel>

<ajaxToolkit:UpdatePanelAnimationExtender ID="UPAE2"  runat="server" TargetControlID="UP1"  BehaviorID="animation" >
        <Animations>
            <OnUpdated>
                  <Parallel duration="0">
      <FadeIn  Duration="5.0" Fps="20" AnimationTarget="GV1" minimumOpacity="0.2" />
                      </Parallel>
            </OnUpdated> 
                <OnUpdating>
                      <Parallel duration="0">
      <FadeOut Duration="5.0" Fps="20" AnimationTarget="GV1" minimumOpacity="0.2" />
                          </Parallel>
            </OnUpdating> 
        </Animations>
    </ajaxToolkit:UpdatePanelAnimationExtender>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900