Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Duplicate ID on Template
posted

I built a webgrid which has a value change according on the the base column.  My question is there another way to do the refresh then an autopostback, and if not, how do I perform the auto post back without this error:

Multiple controls with the same ID '0_0' were found. FindControl requires that controls have unique IDs.
[HttpException (0x80004005): Multiple controls with the same ID '0_0' were found. FindControl requires that controls have unique IDs.]
   System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +273
   System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +320
   System.Web.UI.Control.EnsureNamedControlsTable() +61
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +222
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +327
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +327
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +327
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +327
   System.Web.UI.Page.FindControl(String id) +38
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +113
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Here is my code:
<ig:WebDataGrid ID="myWebGrid" runat="server" Width="100%" AutoGenerateColumns="False" DataSourceID="values">
<Behaviors>
<ig:ColumnResizing />
<ig:Selection CellClickAction="Row" RowSelectType="Multiple"/>
</Behaviors>
<Columns>
<ig:TemplateDataField Key="NameTemplate">
<Header Text="Name" />
<ItemTemplate><%# Eval("Value.Name")%></ItemTemplate>
</ig:TemplateDataField>
<ig:TemplateDataField Key="TypeTemplate">
<Header Text="Value Type" />
<ItemTemplate>
<asp:DropDownList runat="server" ID="_valueTypeDropDown" SelectedIndex='<%# Bind("ValueType.ValueType")%>' AutoPostBack=true>
<asp:ListItem> Frequency </asp:ListItem>
<asp:ListItem> On Change </asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</ig:TemplateDataField>
<ig:TemplateDataField Key="HertzTemplate">
<Header Text="Hertz" />
<ItemTemplate><asp:TextBox ID="_hertzTextBox" runat="server" Text='<%# Bind("ValueType.Value")%>' Enabled='<%# (Elums.Enterprise.Core.ValueTypeValue.Frequency.Equals(Eval("ValueType.ValueType"))) %>' /></ItemTemplate>
</ig:TemplateDataField>
</Columns>
</ig:WebDataGrid>

Parents Reply Children