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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Form Data Disappears Using Back Button 4 24
IEnumerable<T> to a List<T> 8 55
Google Maps with Webforms 1 30
ASP.NET Built-In Report Creator / Viewer 5 25
Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 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