?
Solved

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

Posted on 2007-03-18
5
Medium Priority
?
803 Views
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
0
Comment
Question by:Abdu_Allah
[X]
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
5 Comments
 
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.

Regards,

Wayen
0
 
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.
0
 
LVL 3

Author Comment

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

Then why GridView paging does not work?!
0
 
LVL 3

Author Comment

by:Abdu_Allah
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.
0
 
LVL 47

Accepted Solution

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

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

762 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