473,662 Members | 2,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP? Cookie object use (code behind). so much easy with ASP/COM+

Suggested that I move my question to this post, HELP

I'm struggling with using the HttpCookie object on a code behind. Used in the page works great
I'm getting a: Type 'HttpCookie' is not define

I've tried adding the namespace to the vb form but no luck

Imports System.Data.Sql clien
Imports System.Dat
Imports Syste
Imports System.Web.U
Imports System.Web.UI.W ebControl
Imports System.Web.UI.H tmlControl
Imports System.Web.Http Cooki

It's use

'Now set cooki
Dim objCookie As New HttpCookie("nas bawebsitenew"
objCookie.Value s("userid") = memberdata3("US ER_EMAIL"
objCookie.Value s("userpassword ") = memberdata3("US ER_PASSWORD"
objCookie.Value s("datecreated" ) = Date.Now(
objCookie.Expir es = DateTime.MaxVal u
Response.Cookie s.Add(objCookie

Nov 18 '05 #1
3 1207
Try "Imports System.Web" instead of "Imports System.Web.Http Cookie".

--
John Saunders
johnwsaundersii i at hotmail
"chris" <an*******@disc ussions.microso ft.com> wrote in message
news:7F******** *************** ***********@mic rosoft.com...
Suggested that I move my question to this post, HELP?

I'm struggling with using the HttpCookie object on a code behind. Used in the page works great. I'm getting a: Type 'HttpCookie' is not defined

I've tried adding the namespace to the vb form but no luck.

Imports System.Data.Sql client
Imports System.Data
Imports System
Imports System.Web.UI
Imports System.Web.UI.W ebControls
Imports System.Web.UI.H tmlControls
Imports System.Web.Http Cookie

It's use:

'Now set cookie
Dim objCookie As New HttpCookie("nas bawebsitenew")
objCookie.Value s("userid") = memberdata3("US ER_EMAIL")
objCookie.Value s("userpassword ") = memberdata3("US ER_PASSWORD") objCookie.Value s("datecreated" ) = Date.Now()
objCookie.Expir es = DateTime.MaxVal ue
Response.Cookie s.Add(objCookie )

Nov 18 '05 #2
that was the trick! question is I do 'system.web 'does that mean everything in web (system.web) is open for use? if so, why not just inherit/import system????????? ???
Nov 18 '05 #3
No, System.Web is just System.Web.

--
John Saunders
johnwsaundersii i at hotmail
"chris" <an*******@disc ussions.microso ft.com> wrote in message
news:83******** *************** ***********@mic rosoft.com...
that was the trick! question is I do 'system.web 'does that mean

everything in web (system.web) is open for use? if so, why not just
inherit/import system????????? ???
Nov 18 '05 #4

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

Similar topics

18
2460
by: | last post by:
Please help. After a number of wrong turns and experiments I need advice on login management system to secure our web pages without inconveniencing our visitors or our internal staff. What I need: A system whereby the user only has to register ONCE and he will have automatic entry to ANY page without havinto to RE-LOGIN even if he comes in
14
3250
by: Alec S. | last post by:
Hi, I'm using JavaScript and Cookies for some customization in a web page. There may be several values in the cookie with names that are not known at runtime. I need a way of deleting them. For example, if my site is www.test.com and the cookie contains: label1 fob
3
4861
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be protected by forms authentication. When I create forms authentication at root level it works but when I move my code up to the subfolder I get this error: Server Error in '/TestProjects/FormsAuthenticationTestingArea' Application.
3
1436
by: Chris | last post by:
In VS 6.0 it was easy to create a new dll, compile it, and all the vb runtime files were nicely added to it via the references that you gave. Then in an ASP page youjust referenced, after registering it, like: dll = sbsuserinfo class = cluserinfo function = CheckLogin ' Let's go write the record to db and create cookie if selected Dim myobj Set myobj = server.CreateObject("sbsuserinfo.cluserinfo")
10
1482
by: pcthug | last post by:
Hi All, I am creating multi-tier app in vb.net using visual studio .net. I create a invoice.vb class file with properties, events and methods. This also has a line item collection class (lineitem.vb & lineitems.vb). I create a form (form1.frm) and write the corresponding code to initialize an invoice object, there are textboxes on the form to display the data, an update and load button. My data is stored in an access database.
7
19071
by: itay_k | last post by:
Hi, I dont understand why this is so complicated, just to add one line of cookie header on the GET request. This is my unworking code: import time import Cookie import cookielib, urllib2
1
4463
by: Joe | last post by:
In ASP.NET 1.1 I could detected expired form authentication tickets (which closely coincide with my expired session) by checking for the Authentication Cookie when the login screen loads. If the cookie exists, then decrypt the forms auth. ticket and check to see if it is expired. If so display a message to the user letting them know why they are back on the login screen. The code I used was something like this: Dim cookie as HttpCookie...
6
3348
by: AppleBag | last post by:
I'm having the worst time trying to login to myspace through code. Can someone tell me how to do this? Please try it yourself before replying, only because I have asked this a couple of times in the past in other places, and while the help was much appreciated, it seemed everyone just wanted to 'theoretically' explain how to do it, but when I tried to do it myself, I couldn't login. I want to simply pass the email address and password to...
0
5558
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
0
8435
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8547
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7368
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1754
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.