473,465 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

repeater datasource viewstate error

Hello,

I have run into a strange situation.

I have a control in which I am trying to sort the datasource of a
repeater and bind the arraylist data back to the repeater. Whenever I do
this I get an error stating that there were multiple controls with the
same id. The stack trace shows the following:

System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState)
which leads me to beleive that there is a naming collission in the view
state.

The control contains 2 embeded repeaters. The sort image button is a
control within in the top level repeater. When the sort button is
clicked the sort criteria is determined from a list box next to the
button. The data source (2d arrayList) for the top level repeater is
aquired, the appropriate sub data list is aquired according to the
command argument, it is then sorted and the entire arraylist is bound
back to the the data source of the top level repeater.

The sort event is thrown from within the reapter so it is handled by an
ItemCommand event handler. The sorting works fine, I have verified the
data. The problem occurs when I try to bind the data back to the
repeater.

Any insight that can be provided will be very helpful.

aspx code example:

<ASP:REPEATER id="repeaterDataSummary" runat="server"
onItemDataBound="ShowDataSummary" OnItemCommand="Button_ItemCommand">

<asp:ImageButton id="imageButtonSortFlightsx" ImageUrl="/sort.gif"
BorderWidth="0" CommandName="SortDataSummary" runat="server"
CommandArgument="<%# Container.ItemIndex%>" />

aspx.cs code example:

protected void Button_ItemCommand(object sender ,
RepeaterCommandEventArgs e)
{
try{
switch(e.CommandName){

case "SortFlightsCommandName":

this.repeaterSchedule.DataSource =
SortedDataSummaryList();

this.repeaterSchedule.DataBind();

break;

default: break;
}
}
catch(Exception ex){//handle ex.}
Nov 18 '05 #1
0 1319

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
2
by: Mark | last post by:
I am trying to use a Pagable Repeater with checkboxes in ASP.Net, I cannot seem to associate the checkbox with a particular database record so I lose the checked state from page-to-page. Below is...
1
by: Dan Nash | last post by:
Hi guys Just developing a cool list that pulls data from an SQL database. I've got a nice header, a footer, borders down the side, but no top/bottom borders for the rows, and onmouseover /...
8
by: Matthew Curiale | last post by:
I am creating an app that lists clients of a company for management of different attributes for that company. The first page is a listing of the companies currently in the database. I have my...
1
by: olduncleamos | last post by:
Hello all, I am experimenting with the repeater control and ran into something that I wasn't expecting. I would appreciate if the experts can confirm or correct my understanding. Here is a...
1
by: ratnakarp | last post by:
Hi, I have a search text box. The user enters the value in the text box and click on enter button. In code behind on button click i'm writing the code to get the values from the database and...
2
by: John Haycock | last post by:
Hi All I have a user control that uses a repeater to build a list of menu links: <itemtemplate> <li> <a href='news.aspx?newsID=<%# DataBinder.Eval(Container.DataItem,"newsID") %>'> <%#...
0
by: Eugene Anthony | last post by:
The problem with my coding is that despite removing the records stored in the array list, the rptPages repeater control is still visible. The rptPages repeater control displayes the navigation...
0
by: Eugene Anthony | last post by:
BlogListingAll.aspx ------------------- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="user_BlogListingAll.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.