473,396 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

User GUID

I'm making the move from classic ASP to .NET.

I've got a getUserGUID method that I've rewritten in C#. I used to use
includes to access this function.

I've created a new class with this method, but I keep getting an "The type
or namespace name 'Request' could not be found" error.

Here's the method:

public class userFunctions

{

public string getUserGUID()

{

string sGUID =
Request.Cookies[ConfigurationSettings.AppSettings["GUID_NAME"]].Value;

if (sGUID == "")

{

HttpCookie UserGUIDCookie = new HttpCookie("UserGUID");

sGUID = System.Guid.NewGuid().ToString().Replace("{", "").Replace("-",
"").Replace("}", "");

UserGUIDCookie.Value = sGUID;

Response.Cookies.Add(UserGUIDCookie);

}

return sGUID;

}

}
Thanks,

JJ
Nov 16 '05 #1
1 1308
Try this.

HttpContext.Current.Request

- Michael S
"Jeff Johnson" <je**********@hotmail.com> wrote in message
news:O1**************@TK2MSFTNGP10.phx.gbl...
I'm making the move from classic ASP to .NET.

I've got a getUserGUID method that I've rewritten in C#. I used to use
includes to access this function.

I've created a new class with this method, but I keep getting an "The type
or namespace name 'Request' could not be found" error.

Here's the method:

public class userFunctions

{

public string getUserGUID()

{

string sGUID =
Request.Cookies[ConfigurationSettings.AppSettings["GUID_NAME"]].Value;

if (sGUID == "")

{

HttpCookie UserGUIDCookie = new HttpCookie("UserGUID");

sGUID = System.Guid.NewGuid().ToString().Replace("{", "").Replace("-",
"").Replace("}", "");

UserGUIDCookie.Value = sGUID;

Response.Cookies.Add(UserGUIDCookie);

}

return sGUID;

}

}
Thanks,

JJ

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of...
9
by: Tiraman :-\) | last post by:
Hi Every one, i have a login form which collect user and password from the user And i would like to give the user an option to remember his user and password for the next time. what is the...
6
by: MuZZy | last post by:
Hi, I am looking to find a way to get currently logged in user's object GUID without querying ActiveDirectory. For example, when i log in to my laptop from home, I'm not on the office network so...
3
by: daokfella | last post by:
I want to be able to store profile information for a user when they sign up for an account...but BEFORE they can log in. Can this be done using any of the built-in profile methods? Here's my...
3
by: shapper | last post by:
Hello, On my web site I have a property, Visitor, which is available for Anonymous users: public class Visitor { public CultureInfo Culture { get; set; } public List<GuidPolls { get; set;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.