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

Posted on 2007-03-18
Last Modified: 2008-02-01
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
Question by:Abdu_Allah
  • 3
  • 2
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 18745293
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.


LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 18745299
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.

Author Comment

ID: 18746901
>If you are trying to set the PageIndex, there's no need

Then why GridView paging does not work?!

Author Comment

ID: 18746914
What is the alternative of NewPageIndex in ASP.NET 2.0?
In ASP.NET 1.1 NewPageIndex was a member of System.EventArgs.
LVL 47

Accepted Solution

Wayne Taylor (webtubbs) earned 500 total points
ID: 18746955
NewPageIndex is a member of DataGridPageChangedEventArgs, not System.EventArgs.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Execute Stored Procedure for a set of values 5 45
Registering DLL 5 43
Error in page 3 46
Name space syntax error 12 44
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now