datagrid's itemcommand event gets fired

M

Manick

Can someone help me why is the following behaviour -
0. The page has a resultsGrid(datagrid) and a submit button.
1. On clicking any control within datagrid, resultsGrid_ItemDataBound is
fired.
2. User click's back button of the browser.
3. User clicks on a submit button outside the datagrid.
4. resultsGrid_ItemDataBound is also gets fired along with submit button
click event handler.

The requirement at 4. is, resultsGrid_ItemDataBound is not suppose to be
called.
 
M

Manick

event handler for submit button is a separate method. The surprise is both
resultsGrid_ItemCommand and Submit1_Click are executed at step 4.

Alvin Bruney - ASP.NET MVP said:
how is the event handler wired up? to which event is it mapped?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Manick said:
Can someone help me why is the following behaviour -
0. The page has a resultsGrid(datagrid) and a submit button.
1. On clicking any control within datagrid, resultsGrid_ItemCommand is
fired.
2. User click's back button of the browser.
3. User clicks on a submit button outside the datagrid.
4. resultsGrid_ItemCommand is also gets fired along with submit button
click event handler.

The requirement at 4. is, resultsGrid_ItemCommand is not suppose to be
called.
 
B

Ben

just a thought....check your page_load and see if ur binding the
datagrid on all page loads or only intial one(if (!page.ispostback)).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top