Click here to Skip to main content
16,005,682 members
Home / Discussions / Web Development
   

Web Development

 
GeneralUsing session state in SQLServer mode Pin
Senkwe Chanda16-Apr-02 22:22
Senkwe Chanda16-Apr-02 22:22 
GeneralRe: Using session state in SQLServer mode Pin
Michael P Butler16-Apr-02 22:34
Michael P Butler16-Apr-02 22:34 
GeneralRe: Using session state in SQLServer mode Pin
Senkwe Chanda17-Apr-02 1:02
Senkwe Chanda17-Apr-02 1:02 
GeneralRe: Using session state in SQLServer mode Pin
James T. Johnson17-Apr-02 1:37
James T. Johnson17-Apr-02 1:37 
GeneralRe: Using session state in SQLServer mode Pin
Senkwe Chanda17-Apr-02 2:17
Senkwe Chanda17-Apr-02 2:17 
GeneralRe: Using session state in SQLServer mode Pin
Senkwe Chanda17-Apr-02 23:14
Senkwe Chanda17-Apr-02 23:14 
GeneralRe: Using session state in SQLServer mode Pin
James T. Johnson18-Apr-02 22:53
James T. Johnson18-Apr-02 22:53 
GeneralUri - System.NullReferenceException - HELP! Pin
pedershk16-Apr-02 21:44
pedershk16-Apr-02 21:44 
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>
/// Summary description for adtracker.
/// </summary>
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);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>adtracker</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<LINK href="http://mail.forbrukerkraft.no/fkweb/webinterface/styles/main.css" type="text/css" rel="stylesheet">
</HEAD>
<body>
<form id="adtracker" method="post" runat="server">
&nbsp;
<asp:Label id="labelMessage" runat="server" Width="139px">Label</asp:Label>
</form>
</body>
</HTML>

[/code]

Now - I'm constantly getting a System.NullReferenceException on this line:

[code]
strReferrer = uriReferrer.ToString();
[/code]

- which stumps me, since I've properly declared the strReferrer String object further up in the code, as you can see above.

There seems to be a serious gap in my knowledge somewhere here.. Can anyone try to do this on their own machine and tell me what happens? (obviously the referrer will be blank if you don't link it up from somewhere and click on the link - but that doesn't really matter - does it???)

Thanks for any help you can provide...


Henning Kilset Pedersen
Forbrukerkraft AS
IT Manager


QuestionResponse.Expires: what exactly does it do? Pin
Alvaro Mendez16-Apr-02 11:23
Alvaro Mendez16-Apr-02 11:23 
AnswerRe: Response.Expires: what exactly does it do? Pin
Philip Patrick16-Apr-02 21:27
professionalPhilip Patrick16-Apr-02 21:27 
QuestionASP problem...??? Pin
alex.barylski16-Apr-02 8:44
alex.barylski16-Apr-02 8:44 
AnswerRe: ASP problem...??? Pin
alex.barylski16-Apr-02 9:10
alex.barylski16-Apr-02 9:10 
AnswerRe: ASP problem...??? Pin
alex.barylski16-Apr-02 9:14
alex.barylski16-Apr-02 9:14 
GeneralRe: ASP problem...??? Pin
Philip Patrick16-Apr-02 21:21
professionalPhilip Patrick16-Apr-02 21:21 
QuestionDebugging COM object? Pin
Philip Patrick15-Apr-02 4:57
professionalPhilip Patrick15-Apr-02 4:57 
AnswerRe: Debugging COM object? Pin
MS le Roux16-Apr-02 22:46
MS le Roux16-Apr-02 22:46 
GeneralProblem with getting access to registry from an ASP page. Pin
Bart-Man15-Apr-02 4:42
Bart-Man15-Apr-02 4:42 
GeneralSolution to my Problem Pin
Bart-Man15-Apr-02 5:03
Bart-Man15-Apr-02 5:03 
GeneralRe: Solution to my Problem Pin
Philip Patrick15-Apr-02 22:34
professionalPhilip Patrick15-Apr-02 22:34 
GeneralRe: Solution to my Problem Pin
Bart-Man17-Apr-02 9:57
Bart-Man17-Apr-02 9:57 
Generalrefresh the parent window Pin
kukum11-Apr-02 19:11
kukum11-Apr-02 19:11 
GeneralRe: refresh the parent window Pin
David Wengier11-Apr-02 19:43
David Wengier11-Apr-02 19:43 
GeneralEnable/Disable Leaves in Menu Pin
Rama Kanth11-Apr-02 3:00
Rama Kanth11-Apr-02 3:00 
GeneralSqlConnection object with ASP .NET Pin
Senkwe Chanda10-Apr-02 22:47
Senkwe Chanda10-Apr-02 22:47 
GeneralRe: SqlConnection object with ASP .NET Pin
James T. Johnson10-Apr-02 23:06
James T. Johnson10-Apr-02 23:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.