• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 827
  • Last Modified:

Why I am getting the following error: 'NewPageIndex' is not a member of 'System.EventArgs'

Why I am getting the following error: 'NewPageIndex' is not a member of 'System.EventArgs'

Here is the code:

Protected Sub GridView1_PageIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.PageIndexChanged
        GridView1.PageIndex = e.NewPageIndex
End Sub
0
Abdu_Allah
Asked:
Abdu_Allah
  • 3
  • 2
1 Solution
 
Wayne Taylor (webtubbs)Commented:
Hi Abdu_Allah,

What is it you are trying to do? If you are trying to set the PageIndex, there's no need, because it has already been changed. That's why that event was raised.

Regards,

Wayen
0
 
Wayne Taylor (webtubbs)Commented:
BTW - The reason you are getting that error is becase NewPageIndex is not a member of 'System.EventArgs', exactly as the error stated. You can only use those members available to a given object.
0
 
Abdu_AllahAuthor Commented:
>If you are trying to set the PageIndex, there's no need

Then why GridView paging does not work?!
0
 
Abdu_AllahAuthor Commented:
What is the alternative of NewPageIndex in ASP.NET 2.0?
In ASP.NET 1.1 NewPageIndex was a member of System.EventArgs.
0
 
Wayne Taylor (webtubbs)Commented:
NewPageIndex is a member of DataGridPageChangedEventArgs, not System.EventArgs.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now