null reference in application object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim Meisterich

    #1

    null reference in application object

    I am trying to move an application that i created to my isp. My application
    runs on my local machine. Howerever I am gettting a null reference point to
    an application variable I created.

    In my default.aspx page I have the following line in my page load event

    TextBox1.Text = Application["BaseURL"].ToString();

    This triggers the
    Object reference not set to an instance of an object.
    error.

    Could there be something wrong with the way my isp has configured my asp.net
    application? Any help is appreciated.

    regards,
    Jim Meisterich




  • Kevin Spencer

    #2
    Re: null reference in application object

    Apparently, the variable has not been intitialized. Where do you create it?

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    All hotels in Benidorm. The best selection of Benidorm hotels with reviews and maps. Book in advance and save.

    Big Things are made up of
    Lots of Little Things.

    "Jim Meisterich" <jjimmeist@eart link.net> wrote in message
    news:VUBlb.1412 0$Uz6.2115@news read1.news.atl. earthlink.net.. .[color=blue]
    > I am trying to move an application that i created to my isp. My[/color]
    application[color=blue]
    > runs on my local machine. Howerever I am gettting a null reference point[/color]
    to[color=blue]
    > an application variable I created.
    >
    > In my default.aspx page I have the following line in my page load event
    >
    > TextBox1.Text = Application["BaseURL"].ToString();
    >
    > This triggers the
    > Object reference not set to an instance of an object.
    > error.
    >
    > Could there be something wrong with the way my isp has configured my[/color]
    asp.net[color=blue]
    > application? Any help is appreciated.
    >
    > regards,
    > Jim Meisterich
    >
    >
    >
    >[/color]


    Comment

    • Kevin Spencer

      #3
      Re: null reference in application object

      Apparently, the variable has not been intitialized. Where do you create it?

      --
      HTH,

      Kevin Spencer
      Microsoft MVP
      ..Net Developer
      All hotels in Benidorm. The best selection of Benidorm hotels with reviews and maps. Book in advance and save.

      Big Things are made up of
      Lots of Little Things.

      "Jim Meisterich" <jjimmeist@eart link.net> wrote in message
      news:VUBlb.1412 0$Uz6.2115@news read1.news.atl. earthlink.net.. .[color=blue]
      > I am trying to move an application that i created to my isp. My[/color]
      application[color=blue]
      > runs on my local machine. Howerever I am gettting a null reference point[/color]
      to[color=blue]
      > an application variable I created.
      >
      > In my default.aspx page I have the following line in my page load event
      >
      > TextBox1.Text = Application["BaseURL"].ToString();
      >
      > This triggers the
      > Object reference not set to an instance of an object.
      > error.
      >
      > Could there be something wrong with the way my isp has configured my[/color]
      asp.net[color=blue]
      > application? Any help is appreciated.
      >
      > regards,
      > Jim Meisterich
      >
      >
      >
      >[/color]


      Comment

      Working...