Solved

error trying to go to page 2

Posted on 2013-01-30
6
130 Views
Last Modified: 2013-01-30
The information in the gridview displays fine, but when I try to go to page 2 I get an error:

error when click on tab

Here are the error details:

System.NullReferenceException was unhandled by user code
  Message=Object reference not set to an instance of an object.
  Source=Framework
  StackTrace:
       at Framework.Utilities.ExceptionManager.LogException(Exception ex) in C:\R13\Framework\Utilities\ExceptionManager.cs:line 16
       at Reo.Global.Application_Error(Object sender, EventArgs e) in C:\R13\Reo\Global.asax.cs:line 65
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Web.HttpApplication.RaiseOnError()
  InnerException: 

Open in new window

0
Comment
Question by:Tom Knowlton
[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
  • 4
  • 2
6 Comments
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 38836380
More info:

Message      "The GridView 'gvPendingRepairBids' fired event PageIndexChanging which wasn't handled."      string


Assuming I handle the event as suggested...what would I put inside it?

Or do I leave the event empty?
0
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 38836405
With default GridView you don't have to handle PageIndexChanging unless I am missing something.
So make sure your GridView markup doesn't have any OnPageIndexChanging set.

Now if it's needed in your case...check this:
 http://www.jigsawboys.com/2008/10/22/the-gridview-fired-event-pageindexchanging-which-wasnt-handled/
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 38836473
For some reason it thinks it is needed.


But yeah, I have it fixed now:


     protected void gvPendingRepairBids_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            SetPendingRepairsGridData(e.NewPageIndex);            
        }

        private void SetPendingRepairsGridData(int pageindex)
        {
            int atid = AssetTask.AssetUnitID;
            int atsid = AssetTask.AssetUnitSID;

            using (MarketingDataContext dc2 = new MarketingDataContext())
            {
                this.gvPendingRepairBids.PageIndex = pageindex;
                _pendingRepairBids = dc2.Marketing_Plan_PendingRepairBids_Get(atid, atsid).ToList<Marketing_Plan_PendingRepairBids_GetResult>();
                this.gvPendingRepairBids.DataSource = _pendingRepairBids;
                this.gvPendingRepairBids.DataBind();
            }
        }

Open in new window

0
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!

 
LVL 5

Author Closing Comment

by:Tom Knowlton
ID: 38836479
Thanks guru_sami.

You are 2 for 2 today on my questions, a perfect record!
0
 
LVL 41

Expert Comment

by:guru_sami
ID: 38836494
Glad it's helping :)
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 38836513
It is.

I don't know what other software developers are like, but it does not come as "easily" to me as to some others I have observed.  I know what things I've done and I know what is possible, but can never seem to get it to STICK in my brain.  Sigh.

So, I really appreciate a second pair of eyes.  : )
0

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

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…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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