ASP.Net Error: cannot convert from 'System.Web.UI.WebControls.GridViewPageEventArgs' to 'System.Web.UI.WebControls.CommandEventArgs'

Last Reply on Feb 01, 2018 06:28 AM By dharmendr

Posted on Feb 01, 2018 02:53 AM

I am trying to call lnkCompleted1 on command event in page index changing event in this way

lnkCompleted1_Command(sender, e);

I am getting below error

The best overloaded method match for 'Today_sTask.lnkCompleted1_Command(object, System.Web.UI.WebControls.CommandEventArgs)' has some invalid arguments    

Argument 2: cannot convert from 'System.Web.UI.WebControls.GridViewPageEventArgs' to 'System.Web.UI.WebControls.CommandEventArgs'

Can anyone let me know how can i pass my oncommand event in page index changing event.

To be more clear i have two grids one grid just displays the count of tasks and username

for example and on clicking that number i will get second grid with paging as it has so many records and on clicking paging i need to go to the event lnkCompleted1_Click by passing username of that particular user whom we are viewing in second grid suppose if we click radha when i click on paging of second grid i should pass that user radha to lnkCompleted1_Click event

User                                       Completed batches

nandini                                         23

geetha                                          2

radha                                            4

 

You are viewing reply posted by: dharmendr on Feb 01, 2018 06:28 AM.
Posted on Feb 01, 2018 06:28 AM

Why you need to pass the value. You can save user value in session and check the session value in lnkCompleted1_Click as per your condition.