1

When I click on a button which is outside of the GridView in my asp.net page, the GridView rowdatabound event is getting fired before OnClick event for the button. I am using the button for custom paging so I need to reverse the order of these events. Any thoughts ??

Thanks in Advance, - Amit

Amit
  • 35
  • 3
  • 7

2 Answers2

2

Possibly because you are calling DataBind() on the GridView in the Page_Load event. You should note that Page_Load will always be called before the event that raised the postback... the Button_Click in your case.

I suggest reading up on the ASP.NET Page Life cycle to learn more.

Cerebrus
  • 25,615
  • 8
  • 56
  • 70
0

perhaps your gridview enableviewstate = false

Chuck Norris
  • 15,207
  • 15
  • 92
  • 123