Showing posts with label duplicate. Show all posts
Showing posts with label duplicate. Show all posts

Monday, March 26, 2012

Duplicate use of ID for AtlasControlToolkit.PopupControlBehavior

Hi, Im Using April CTP with AtlasControlToolkit-PopupControl

Whenever I use the control specified in the TargetControlID of the PopupControlExtender properties and place it inside a Updatepanel I get this error: Duplicate use of ID for AtlasControlToolkit.PopupControlBehavior

or in other words I would like to update the textbox from somewhere else using a Updatepanel.

<

atlas:UpdatePanelID="UpdatePane12"runat="server"Mode="Conditional"><Triggers><atlas:ControlEventTriggerControlID="DropDownList5"EventName="SelectedIndexChanged"/></Triggers><ContentTemplate><asp:TextBoxID="TextBoxDateFrom"runat="server"></asp:TextBox></ContentTemplate></atlas:UpdatePanel><asp:Panelrunat="server"ID="Panel1"CssClass="popupControl"><atlas:UpdatePanelID="UpdatePanel1"runat="server"><ContentTemplate><atlasToolkit:PopupControlExtenderID="PopupControlExtender1"runat="server"><atlasToolkit:PopupControlPropertiesTargetControlID="TextBoxDateFrom"PopupControlID="Panel1"Position="Bottom"/></atlasToolkit:PopupControlExtender><center><asp:CalendarID="Calendar1"runat="server"OnSelectionChanged="Calendar1_SelectionChanged"DayNameFormat="Shortest"BorderColor="#cccccc"BorderStyle="Solid"Width="180px"BackColor="White"><TodayDayStyleBackColor="#cccccc"/><DayStyleBackColor="Transparent"/><SelectedDayStyleFont-Bold="False"BackColor="IndianRed"/><WeekendDayStyleBackColor="#FFFFCC"/><TitleStyleBackColor="#5d7b9d"BorderColor="Black"Font-Bold="True"ForeColor="White"/></asp:Calendar></center></ContentTemplate></atlas:UpdatePanel></asp:Panel>

This is a known Atlas issue with the April CTP. I believe you'll find a work around for this in this thread:

http://forums.asp.net/thread/1282330.aspx

Duplicate Script Reference

I am trying to create a WebControl dll. There is a common.js file in the dll. It is shared bewteen all WebControls.

If I simply add the script reference using
ScriptManager.Scripts.Add( ...) or implementingGetScriptReferences function of IScriptControl. Duplicate script reference will be created when user add multiple web controls.

It is a problem because a ajax javascript class cannot be registered twice.

If I use ScriptManager.RegisterClientScriptInclude, the script will be unique but it is inserted before ajax javascript liberary.

It seems that I have to do something special to make this work. anyone has suggestions or has experienced the same issue??

thanks

Rushui

Look up the example under ajax.asp.net/docs for the IScriptControl interface. If you implement the interface using their example as a template you shouldn't have issues; I'm not sure what they're doing under the hood, but the GetScriptReferences method specified is being called in some way that helps avoid conflicts.

Upon further investigation, it seems that duplicate script reference of a web control dll can be avoided by implementing GetScriptReference function of IScriptControl interface. The Scripts collection of ScriptManager however doesnot check for duplicates.

My situation is a bit strange since I am trying to share a common js lib between the page and the web control dll. Guess I just have to avoid doing that.

Thanks

Rushui

Duplicate Items in dropdownlist inside an Updatepanel

Hi,

I have been working with Atlas for the past couple of weeks and I have a very simple page with a dropdownlist box inside a updatepanel. I have a button that inserts a value in the back-end database and refresh the dropdownlist. This button is also a trigger for the updatepanel. This dropdownlist is bounded to an ObjectDataSource.

The problem is that on the first click, the values in the dropdownlist are duplicated with the original list and plus the new value. So I have the original list show up twice and the new value at the end. However, on the second click, the dropdownlist is updated correctly with only the new value being appended at the end. Doesn't anyone have the same problem?

ThanksSmile

<atlas:UpdatePanelID="UpdatePanelReason"runat="server"Mode="Conditional">

<ContentTemplate>

<asp:DropDownListID="drpReason"runat="server"AppendDataBoundItems="True"DataSourceID="ObjectDataSource1"DataTextField="ITEM_SUB_TYPE_NAME"DataValueField="PK_ITEM_SUB_TYPE_ID">

<asp:ListItemValue="0">Select Reason</asp:ListItem>

</asp:DropDownList>

</ContentTemplate>

<Triggers>

<atlas:ControlEventTriggerControlID="btnAddReason"EventName="Click"/>

</Triggers>

</atlas:UpdatePanel>

My post-back method to insert a new value in the dropdownlist.

ProtectedSub btnAddReason_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles btnAddReason.Click

IfMe.txtNewReason.Text <>String.EmptyThen

Dim lookupMgrAsNew LookupManager

lookupMgr.insertItemSubType(Me.txtNewReason.Text, Session("ItemType"))

Me.drpReason.DataBind()

EndIf

EndSub

Problem solved!! All I have to do is clear all the items in the dropdownlist before calling databinding.

:)

Duplicate ID error for ReorderList in Repeater

I have a ReorderList in a Repeater and it's giving me "duplicate id" error because ReorderList is generating the same id for the DragDropBehavior. Is this a bug in ReorderList? Does someone know how to fix it temporarily in the source codes?

I think I find the fix. In ReorderList.cs ln 628, change from ID to ClientID will fix the problem.

dwp.ID =this.ClientID +"_behavior";


Hi aching,

This is related to a known issue affecting all our controls that wrap extenders. We hope to fix it pretty soon.

Thanks,
Ted