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 8391423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:15:26+00:00 2026-06-09T19:15:26+00:00

When trying to save an order we first load the object from session. This

  • 0

When trying to save an order we first load the object from session. This works.
Then we add information to the order and put it back into session.
I then receive and Object reference not set to an instance of an object error.

Private Sub SaveOrder()
    'load the order
    Order = Session("Order")

    'Add order information here

    Session("Order") = Order 'The error is occurring here.
End Sub

The stack trace is as follows:

    Error Path: Contact.aspx
    Error Detail: Object reference not set to an instance of an object.
    Error Source: Void __RenderContent1(System.Web.UI.HtmlTextWriter, System.Web.UI.Control)
    Error Stack Trace:    at ASP.orderentry_uc3_contact_aspx.__RenderContent1(HtmlTextWriter __w, Control parameterContainer) in C:\Portal Websites\Portals\OrderEntry\UC3\Contact.aspx:line 9
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Page.Render(HtmlTextWriter writer)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Any help with this would be greatly appreciate.

Added requested code:

Imports ComponentArt.Web.UI

Partial Class OrderEntry_UC3_Contact
Inherits Company.Pages.CompanyPage
Public Order As Company.Orders.UC3.Order

Protected Sub btnNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext.Click
    If Valid() Then
        SaveOrder() 'This is line 9
        Response.Redirect("Payment.aspx")
    End If
End Sub

I’ve added the top of the aspx page (The whole thing is too large).

<%@ Page Language="VB" MasterPageFile="~/Portal/PortalNoFooter.master" AutoEventWireup="false"
    EnableTheming="true" CodeFile="Contact.aspx.vb" Inherits="OrderEntry_UC3_Contact"
    Title="Contact" %>

<%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
      //To large to submit the whole thing
</asp:Content>
enter code here
  • 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-09T19:15:28+00:00Added an answer on June 9, 2026 at 7:15 pm

    Your code examples don’t show the Page_Load or the exact lines around line 9 of the aspx file, but it sounds like you are assuming that Order will be populated at all times. If you are only loading the Order object in Page_Load during a non-postback, when the user clicks the button, the Order object is not being loaded early enough in the page lifecycle.

    Try removing the check for IsPostback and always reload the Order object from the Session.

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

Sidebar

Related Questions

I'm trying to save a file in which I have some credentials. In order
im trying to save a row in my settings table, it works all fine
I'm trying to save a CUploadedFile object in local folder, I am using img
I'm trying to save a huge NSArray to a file and then retrieve it...
I am trying to use hostip in order to save to DB user's general
I am trying to save cascading in EF 4.1 code first. [Table(User)] public class
Not sure if this is even possible but I am trying to save text
I am trying to save an order, and the products in the order. The
I am trying to fetch the information from books associated with a customer but
I'm trying to save a dynamic pdf file generated from a web server using

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.