HighTechTalks DotNet Forums  

Static user control disappears after postback

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Static user control disappears after postback in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Svetoslav Vasilev
 
Posts: n/a

Default Static user control disappears after postback - 11-19-2007 , 03:14 AM






Hi, I have recently come across a subtle behavior of ASP.NET 2.0 user
controls, for which i cannot find the cause and therefore need som help. I
have the following scenario - i need to show one grid view where I can select
individual rows, which are displayed in a second grid upon selection. From
the second grid i have the ability to remove rows individually.
I have developed this as follows - user control A.ascx containing a grid
view and the logic for handling the events fired by it - both select and
remove. It exposes public events that are fired upon corresponding event from
the grid view, so that other controls & pages can be notified if needed. In
another control - B.ascx i have defined 2 instances of the control A through
markup - each with its own ID. The strange behaviour is expressed in that
when I select a row from the first grid, the SelectedIndexChanged is properly
fired, the corresponding logic properly executed, but when the page is
rendered, the first grid disappears and only the second with the selected
rows is shown. If I then try to remove one row from the second grid, the
event fires correctly and the logic executes properly, but the page is
rendered without no grids.
In a breakpoint in the SelectedIndexchanged I noticed that the DataKeys
collection is properly populated, but the Rows collection is empty.
Have anyone experienced similar behaviour and if so, please let me know how
to solve it.
Many thanks in advance!
Svetoslav

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.