Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Uri - System.NullReferenceException - HELP!

Uri - System.NullReferenceException - HELP!

Scheduled Pinned Locked Moved Web Development
csharphtmlasp-netgraphicsdesign
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pedershk
    wrote on last edited by
    #1

    Hello crowd. I'm having some serious issues with my coding.. Can anybody please take a look at this and tell me what's wrong?? Thanks... First of all, the C# code-behind file that's causing my headaches: [code] using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; namespace tracker { /// /// Summary description for adtracker. /// public class adtracker : System.Web.UI.Page { String strReferrer = ""; protected System.Web.UI.WebControls.Label labelMessage; private void Page_Load(object sender, System.EventArgs e) { Uri uriReferrer = Request.UrlReferrer; strReferrer = uriReferrer.ToString(); labelMessage.Text = strReferrer; } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } #endregion } } [/code] And the HTML/ASPX display file, which doesn't really matter, but I'm including it for reference anyways. It just contains my Label (labelMessage) which I'm using for debugging purposes. [code] <%@ Page language="c#" Codebehind="adtracker.aspx.cs" AutoEventWireup="false" Inherits="tracker.adtracker" %> adtracker

    Label

    [/code] Now - I'm constantly getting a System.NullReferenceException on this line: [code] strRefe

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups