473,405 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

postback and webcustomcontrol

Hello,

i have a webcustomcontrol (:CompositeControl) which is in an asp.net page
which causes a postpack-event (ChangeSort).

protected void ChangeSort(Object sender, EventArgs e)

{

Session["Sort1"] = dropDownListSort1.SelectedValue;

Session["Sort2"] =
Int32.Parse(dropDownListSort2.SelectedValue.ToStri ng());

}

ChangeSort only saves 2 variables which are selected in a dropdownlist in
the session.

Then I have a method which compares objects of "IShopAricle" on the in the
session stored variables.

protected int CompareIShopArticleByConfig(IShopArticle x, IShopArticle y)

{

return CompareIShopArticle(x, y, Session["Sort1"].ToString(),
Session["Sort2"].ToString());

}

nothing complicated until here...

now there is a ArticleCollection which is a generic list of IShopArticle

public List<IShopArticle> ArticleCollection = new List<IShopArticle>();

and the method which renders the webcustomcontrol and calls the sort-method.

ArticleList is another webcustomcontrol which is added to this control.

protected override void CreateChildControls()

{

ArticleList articleList = new ArticleList();

this.ArticleCollection.Sort(CompareIShopArticleByC onfig);

articleList.ArticleCollection = this.ArticleCollection ;

this.Controls.Add(articleList);

}
And now the problem: if i select in my dropdownlist something, and the
postback has finished, the correct item in the dropdown is selected, but the
articleList shows the "old" "unsorted" articleList. If i reload the page it
shows the correct sorted content.

There must be something wrong with the order of the events or there must be
something missing.

Could somebody help me please?

thanks a lot,

alex
Mar 20 '06 #1
1 1417
problem solved...
i moved some commands to an other event.
Mar 21 '06 #2

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

Similar topics

2
by: news | last post by:
Hello All, As a VB6/C/C++ (and some Java) developer, I've been toying with c# for the last couple of weeks. I'm currently trying to create a grid of 3x3 with each cell containing numbers from 1...
1
by: Lars Netzel | last post by:
How do I set default values to the "default" properties, like Width, height, Visible, Backcolor... in a WebCustomControl that I'm developing? Best Regards/ Lars
1
by: Cristian | last post by:
Hi, I'm building a WebCustomControl, the principal class which inherits from WebControl has the property ViewState, and I want to access to the ViewState from other classes in my project, but I...
5
by: Arnold | last post by:
Hi, Im building a WebCustomControl. In my principal class (Inherits from WebControl), have a property of type MyCollection (Inherits from CollectionBase), which is a MyItem collection. To mantain...
3
by: Qwert | last post by:
Hello, if you have a WebCustomControl ( inherits from System.Web.UI.WebControls.WebControl ), how do you create an event that responses to the movement of the cursor above the control? ...
1
by: Alexander Widera | last post by:
hi, i have 2 custom webcontrols on one page ... both have buttons (of the class Button) on it with different Click or Command Events. But the problem is, that a click on the button in the second...
1
by: LG | last post by:
I want to add attributes to a custom dropdownlist and I found some code on Internet that doesn't work after post back. First time the control has the attributes, but after postback the attributes...
11
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be...
3
by: ronchese | last post by:
Hello. I wrote a Web Custom Control that have a property named SelectedValue. This SelectedValue property is set after the user clicks a LinkButton control, by its Click() event. I did some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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...

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.