Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8732659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:28:39+00:00 2026-06-13T09:28:39+00:00

I have a problem with Cross-Page Posting a GridView. The error I’m getting is

  • 0

I have a problem with Cross-Page Posting a GridView.

The error I’m getting is the following:
Object reference not set to an instance of an object.

Steps I took:

  1. Create the new Page and add a GridView
  2. Create a button with PostBack to the new page.

    <asp:Button ID="Button1" Text="Button 1" PostBackUrl="~/Page2.aspx?button=1" runat="server" />
    
  3. Adding code behind to the new Page.

    protected void Page_Load(object sender, EventArgs e)
    {
       if (Page.PreviousPage == null)
       {
          Label1.Text = "Vul een planing in.";
       }
       else
       {
          ContentPlaceHolder pageContent =
              (ContentPlaceHolder)(Page.PreviousPage.FindControl("Content1"));
          GridView1.DataSource = pageContent.FindControl("GridView2"); // In this line I'm getting the error
       }
    }
    

Looking at the error I forgot a reference. Thnx for the help:)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:28:40+00:00Added an answer on June 13, 2026 at 9:28 am

    Please check followinf link to fetch previous page control value in another page, so you can use same login in your code, but if the griview contains large amount of data your page performance will get reduced.

    http://www.allinterview.com/showanswers/36626/page4.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem I have a page with a silverlight object. It attempts to retrieve
I have a cross-language problem regarding md5 :). I have this code in Java:
I have a cross-tab report which similar to this Problem is when there are
I have a cross platform app, I want to compile on Linux. The problem
I have problem SIMILAR to preventing form data reposting, but not quite the same
I have the following link to track cross site travelling for google analytics: <a
I have small ajax problem related to cross domain as i see it. On
Here is my problem: We have page contained in iframe (url of iframe page
I have a page which requires use of non-default fonts, and not everyone has
I have problem with http://abfoodpolicy.com/ . In IE 8 and 9 the right sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.