[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Dan Black

3/12/2002 7:34:00 PM

I have an application based on IBuySpy. It even uses the same default page
with right, left and content panes. On the left, I load a menu of choices
for the user. Depending on the choice selected, the content (or center)
pane is loaded with a different user control.

That all works great until a user control with a DataGrid is loaded. Then,
if the user wants to edit a row, a PostBack is generated and the content
pane is empty again.

So I added code to re-populate it in the Page_Load event. Then the DataGrid
is displayed again, but the row is not editable. This is not a very elegant
solution either since there are now two places where the user control is
loaded. Once in the button_click event of the menu and again in the
Page_Load event of the default page.

So then I thought I would move the code that loads the user controls to the
Page_PreRender event. The buttons in the menu just set a Session variable
that tells me which item was clicked, and then in the Page_PreRender event,
the appropriate user control is loaded. This is more elegant since the
control is now loaded in only one place, but unfortunately, the DataGrid's
EditCommand is never generated.

Any ideas how something like this should be structured?

Thanks, Dan