F
Froefel
Probably a beginner's question:
My page has AutoEventWireup=true.
I have a gridview that's bound to an ObjectDataSource that returns
projects as a DataView. One of the columns is an Imagebutton that,
when clicked, takes the user to the details page of the requested
project.
Everything is working OK, except that too many events are firing
needlessly.
Here's the order of events when I first load the page:
1. Page_Init
2. Page_Load
3. Page_PreRender
4. ObjectDataSource's SelectMethod is called and returns a
Dataview
5. GridView1_RowDataBound.... (for each row in the gridview
control because some icons need to be drawn based on each row's
content)
And here's the order of events when I subsequently click the link in
one the rows:
1. Page_Init
2. ObjectDataSource's SelectMethod is called and returns a
Dataview
3. GridView1_RowDataBound
4. Page_Load
5. Page_PreRender
6. GridView1_RowCommand
[followed by the events for the new page]
When first loading the page, things are OK. However, when clicking the
link, it appears that too much is happening; the gridview should't be
repopulated because I'm moving away to another page anyway.
In the RowCommand event I packed the requested action
("SelectProject") in the CommandType parameter and the selected
projectID in the CommandArgument, so I don't need access to the
gridview data anymore in order to go to the requested page.
How should I handle this? Any suggestions are welcome.
-- Hans
My page has AutoEventWireup=true.
I have a gridview that's bound to an ObjectDataSource that returns
projects as a DataView. One of the columns is an Imagebutton that,
when clicked, takes the user to the details page of the requested
project.
Everything is working OK, except that too many events are firing
needlessly.
Here's the order of events when I first load the page:
1. Page_Init
2. Page_Load
3. Page_PreRender
4. ObjectDataSource's SelectMethod is called and returns a
Dataview
5. GridView1_RowDataBound.... (for each row in the gridview
control because some icons need to be drawn based on each row's
content)
And here's the order of events when I subsequently click the link in
one the rows:
1. Page_Init
2. ObjectDataSource's SelectMethod is called and returns a
Dataview
3. GridView1_RowDataBound
4. Page_Load
5. Page_PreRender
6. GridView1_RowCommand
[followed by the events for the new page]
When first loading the page, things are OK. However, when clicking the
link, it appears that too much is happening; the gridview should't be
repopulated because I'm moving away to another page anyway.
In the RowCommand event I packed the requested action
("SelectProject") in the CommandType parameter and the selected
projectID in the CommandArgument, so I don't need access to the
gridview data anymore in order to go to the requested page.
How should I handle this? Any suggestions are welcome.
-- Hans