T
tshad
I get the following error:
PageInit.cs(43,71): error CS0246: The type or namespace name 'User' could
not be
found (are you missing a using directive or an assembly reference?)
The error is from the last line in this snippet of code
*****************************************
using System;
using System.Web;
using System.IO;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.SessionState;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using Microsoft.VisualBasic;
using MyFunctions;
namespace MyFunctions
{
public class PageInit
{
public static void PageSetup(MyFunctions.Page thePage)
{
HttpContext.Current.Session["LastPageVisited"] =
(User)HttpContext.Current.Session["User"].LastPageVisited;
**************************************************************
I have stored and object "User" in my session variable and am trying to get
access to LastPageVisited. I originally didn't have the (User) in front of
the line and got the error that LastPageVisited didn't exist. So I typecast
the whole string - but got the error:
I have a User Class in the MyFunctions namespace that is in the compiler
line:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc /t:library PageInit.cs
/r:system.web.dll /r:system.data.dll /r:system.dll
/r:Microsoft.VisualBasic.dll /r:refresh.dll /r:User.dll
And the User Class is setup like:
*************************************************
using System;
using System.IO;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using MyFunctions;
using FtsData;
namespace RolesBasedAuthentication
{
[Serializable]
public class User
{
private string lastPageVisited = "";
....
public string LastPageVisited
{
get { return lastPageVisited; }
set { lastPageVisited = value; }
}
**************************************************
So do I need to change the following line to work?
(User)HttpContext.Current.Session["User"].LastPageVisited;
The problem seems to be the User doesn't exist but it does (doesn't it?).
Thanks,
Tom
PageInit.cs(43,71): error CS0246: The type or namespace name 'User' could
not be
found (are you missing a using directive or an assembly reference?)
The error is from the last line in this snippet of code
*****************************************
using System;
using System.Web;
using System.IO;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.SessionState;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using Microsoft.VisualBasic;
using MyFunctions;
namespace MyFunctions
{
public class PageInit
{
public static void PageSetup(MyFunctions.Page thePage)
{
HttpContext.Current.Session["LastPageVisited"] =
(User)HttpContext.Current.Session["User"].LastPageVisited;
**************************************************************
I have stored and object "User" in my session variable and am trying to get
access to LastPageVisited. I originally didn't have the (User) in front of
the line and got the error that LastPageVisited didn't exist. So I typecast
the whole string - but got the error:
I have a User Class in the MyFunctions namespace that is in the compiler
line:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc /t:library PageInit.cs
/r:system.web.dll /r:system.data.dll /r:system.dll
/r:Microsoft.VisualBasic.dll /r:refresh.dll /r:User.dll
And the User Class is setup like:
*************************************************
using System;
using System.IO;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using MyFunctions;
using FtsData;
namespace RolesBasedAuthentication
{
[Serializable]
public class User
{
private string lastPageVisited = "";
....
public string LastPageVisited
{
get { return lastPageVisited; }
set { lastPageVisited = value; }
}
**************************************************
So do I need to change the following line to work?
(User)HttpContext.Current.Session["User"].LastPageVisited;
The problem seems to be the User doesn't exist but it does (doesn't it?).
Thanks,
Tom