Quite honestly, none of the responses posted in this thread should be considered a solution. I've encountered this issue and the posted answer does not solve my problem. If I'm trying to use the DropDownExtender on the AjaxToolkit inside a FormView I cannot
use the same name across Templates or other FormViews. This is a major PITA and changing the name for each control (20 in each formview * 5 formviews * 3 templates) is quite cumbersome.
Obviously, setting the UpdatePanel for the Status Label control above outside of the EditTemplate would not work since then the animation would affect the update panel itself and not the label control. And right now the StatusLabel
control shows up as already defined on the page which doesn't pop up if I eliminate the UpdatePanel around the StatusLabel (but that's not an option).
axeman420
Member
46 Points
52 Posts
Re: UpdatePanel in FormView name conflict compilation error
Oct 03, 2008 07:33 PM|LINK
Quite honestly, none of the responses posted in this thread should be considered a solution. I've encountered this issue and the posted answer does not solve my problem. If I'm trying to use the DropDownExtender on the AjaxToolkit inside a FormView I cannot use the same name across Templates or other FormViews. This is a major PITA and changing the name for each control (20 in each formview * 5 formviews * 3 templates) is quite cumbersome.
Dropdown - AjaxToolkit
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/DropDown/DropDown.aspx
My Sample Code:
<
asp:FormView ID="fvCMRecord" runat="server" DataSourceID="odsCMRecord" CssClass="formView" Visible="False" ondatabound="fvCMRecord_DataBound" onitemupdating="fvCMRecord_ItemUpdating" oniteminserting="fvCMRecord_ItemInserting" oniteminserted="fvCMRecord_ItemInserted" onitemupdated="fvCMRecord_ItemUpdated"> <EditItemTemplate> <div class="heading"> <ul class="tabs"> <li><b>Request Details</b></li> </ul> <div class="mini-loader"> <asp:UpdateProgress ID="upgEditLoading" runat="server" AssociatedUpdatePanelID="updFVCMRecord" DynamicLayout="false"> <ProgressTemplate> <img src="images/mini-loader-blue.gif" alt="loading..." /> </ProgressTemplate> </asp:UpdateProgress> </div> </div> <div class="row"> <div class="leftTitle">Case Number:</div> <div class="leftField"><asp:Label ID="CaseNumberLabel" runat="server" Text='<%# Bind("CaseNumber") %>' /></div> <div class="rightTitle">Date Created:</div> <div class="rightField"><asp:Label ID="DateCreatedLabel" runat="server" Text='<%# Bind("DateCreated", "{0:g}") %>' /></div> </div> <div class="row"> <div class="leftTitle">Status:</div> <div class="leftField"> <asp:UpdatePanel ID="updStatus" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:Label ID="StatusLabel" runat="server" Text='<%# Bind("Status") %>' SkinID="EditShort" /> <ajax:DropDownExtender ID="ddeStatus" runat="server" TargetControlID="StatusLabel" DropDownControlID="pnlStatus" /> <asp:ObjectDataSource ID="odsStatus" runat="server" SelectMethod="GetStatus" TypeName="CHAT.Bll.Utils.UtilsManager" /> <asp:Panel ID="pnlStatus" runat="server" Width="81" SkinID="DropDown"> <asp:RadioButtonList ID="rdlStatus" runat="server" DataSourceID="odsStatus" RepeatDirection="Vertical" AutoPostBack="true" OnSelectedIndexChanged="OnSelect" /> </asp:Panel> </ContentTemplate> </asp:UpdatePanel> <ajax:UpdatePanelAnimationExtender ID="uaeStatus" runat="server" TargetControlID="updStatus"> <Animations> <OnUpdated> <Sequence> <Color AnimationTarget="StatusLabel" Duration="0.5" PropertyKey="backgroundColor" StartValue="#6CAF3C" EndValue="#FFFFFF" /> </Sequence> </OnUpdated> </Animations> </ajax:UpdatePanelAnimationExtender> </div> <div class="rightTitle">Owner:</div> <div class="rightField"><asp:Label ID="OwnerLabel" runat="server" Text='<%# Bind("Owner") %>' /></div> </div></EditItemTemplate>
</asp:FormView>
FormView2
<
asp:FormView ID="fvOffers" runat="server" DataSourceID="odsOfferRecord" CssClass="formView" Visible="False"> <EditItemTemplate> <div class="heading"> <ul class="tabs"> <li><b>Request Details</b></li> </ul> <div class="mini-loader"> <asp:UpdateProgress ID="upgEditLoading" runat="server" AssociatedUpdatePanelID="updFVOffers" DynamicLayout="false"> <ProgressTemplate> <img src="images/mini-loader-blue.gif" alt="loading..." /> </ProgressTemplate> </asp:UpdateProgress> </div> </div> <div class="row"> <div class="leftTitle">Case Number:</div> <div class="leftField"><asp:Label ID="CaseNumberLabel" runat="server" Text='<%# Bind("CaseNumber") %>' /></div> <div class="rightTitle">Date Created:</div> <div class="rightField"><asp:Label ID="DateCreatedLabel" runat="server" Text='<%# Bind("DateCreated", "{0:g}") %>' /></div> </div> <div class="row"> <div class="leftTitle">Status:</div> <div class="leftField"> <asp:UpdatePanel ID="updStatus" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:Label ID="StatusLabel" runat="server" Text='<%# Bind("Status") %>' SkinID="EditShort" /> <ajax:DropDownExtender ID="ddeOffersStatus" runat="server" TargetControlID="StatusLabel" DropDownControlID="pnlOffersStatus" /> <asp:ObjectDataSource ID="odsOffersStatus" runat="server" SelectMethod="GetStatus" TypeName="CHAT.Bll.Utils.UtilsManager" /> <asp:Panel ID="pnlOffersStatus" runat="server" Width="81" SkinID="DropDown"> <asp:RadioButtonList ID="rdlOffersStatus" runat="server" DataSourceID="odsOffersStatus" RepeatDirection="Vertical" AutoPostBack="true" OnSelectedIndexChanged="OnSelect" /> </asp:Panel> </ContentTemplate> </asp:UpdatePanel> <ajax:UpdatePanelAnimationExtender ID="uaeStatus" runat="server" TargetControlID="updStatus"> <Animations> <OnUpdated> <Sequence> <Color AnimationTarget="OffersStatusLabel" Duration="0.5" PropertyKey="backgroundColor" StartValue="#6CAF3C" EndValue="#FFFFFF" /> </Sequence> </OnUpdated> </Animations> </ajax:UpdatePanelAnimationExtender> </div> <div class="rightTitle">Owner:</div> <div class="rightField"><asp:Label ID="OwnerLabel" runat="server" Text='<%# Bind("Owner") %>' /></div> </div></EditItemTemplate>
</FormView>
Obviously, setting the UpdatePanel for the Status Label control above outside of the EditTemplate would not work since then the animation would affect the update panel itself and not the label control. And right now the StatusLabel control shows up as already defined on the page which doesn't pop up if I eliminate the UpdatePanel around the StatusLabel (but that's not an option).
Regards,
Axel