T
tshad
I am getting the following messages from my compile code:
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?)
PageInit.cs(43,76): error CS0117: 'object' does not contain a definition for
'LastPageVisited'
User is an object I have in my session variables that works fine in VB.Net
but there is something missing here.
The Compiler Code is:
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
The code snippet giving me the problem looks like (the last line is the
offender):
************************************
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;
***********************************
My User class looks something 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; }
}
....
*************************************
This is the piece that is giving me the problem:
(User)HttpContext.Current.Session["User"].LastPageVisited
Why doesn't it see the User object? It is in the MyFunctions namespace. I
also tried adding the following line just to see:
using Myfunctions;
But that didn't work, either.
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?)
PageInit.cs(43,76): error CS0117: 'object' does not contain a definition for
'LastPageVisited'
User is an object I have in my session variables that works fine in VB.Net
but there is something missing here.
The Compiler Code is:
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
The code snippet giving me the problem looks like (the last line is the
offender):
************************************
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;
***********************************
My User class looks something 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; }
}
....
*************************************
This is the piece that is giving me the problem:
(User)HttpContext.Current.Session["User"].LastPageVisited
Why doesn't it see the User object? It is in the MyFunctions namespace. I
also tried adding the following line just to see:
using Myfunctions;
But that didn't work, either.
Thanks,
Tom