Click here to Skip to main content
15,908,661 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Excel and Asp.net Pin
minhpc_bk26-Sep-06 20:16
minhpc_bk26-Sep-06 20:16 
Questionmodule Pin
amaneet26-Sep-06 18:41
amaneet26-Sep-06 18:41 
AnswerRe: module Pin
minhpc_bk26-Sep-06 19:59
minhpc_bk26-Sep-06 19:59 
QuestionWhat is the memory limitation of ASP.Net worker process ? Pin
King Shez26-Sep-06 18:15
King Shez26-Sep-06 18:15 
AnswerRe: What is the memory limitation of ASP.Net worker process ? Pin
minhpc_bk26-Sep-06 19:52
minhpc_bk26-Sep-06 19:52 
QuestionHelp for Nested grid Pin
Kokila.B26-Sep-06 17:50
Kokila.B26-Sep-06 17:50 
AnswerRe: Help for Nested grid Pin
Jay_se26-Sep-06 19:38
Jay_se26-Sep-06 19:38 
QuestionCookies - Problem setting them Pin
dgonzale26-Sep-06 16:32
dgonzale26-Sep-06 16:32 
Hi,

I'm new using cookies, I have been trying or testing one with no luck, please see the code below and tell me what I'm doing wrong. Just to let you know, my IE settings allow me to accept cookies.

This is the default.aspx page

Public index As Integer
Public viewexistingcookies As Boolean

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
index = IIf(Request("index") Is Nothing, 0, Convert.ToInt32(Request("index")))
viewexistingcookies = IIf(Request("vc") Is Nothing, False, Convert.ToBoolean(Request("vc")))

If Not (Page.IsPostBack) Then
SetGetCookie()
If viewexistingcookies Then
ViewCookies()
End If
End If

Me.HeaderMostrarInformacionDeUsuario = True
Me.HeaderInformaciondeUsuario = Session("FirstName") 'It could be assigned directly from the cookie
Me.HeaderSubMenuOptions = Tools.GetSubMenuItems
Me.HeaderSubMenuSelectedOption = index

End Sub 'Page_Load

Private Sub SetGetCookie()
If Not Request.Cookies("p26m") Is Nothing Then
Dim cookie As HttpCookie = Request.Cookies("p26m")
Session("FirstName") = Server.HtmlEncode(cookie.Values("firstname")) & "</b>"
Else
Dim cookie As New HttpCookie("p26m")
cookie.Expires = Date.Now.AddYears(1)
cookie.Secure = True
'I'm adding this values for now, they will come from a registration form
cookie.Values.Add("firstname", "David")
cookie.Values.Add("lastname", "Gonzalez")
cookie.Values.Add("email", "dgonzale@med.miami.edu")
Response.AppendCookie(cookie)
End If
End Sub 'SetGetCookie

'I'm using this routine to get current cookies
Public Sub ViewCookies()
Dim loop1, loop2 As Integer
Dim arr1(), arr2() As String
Dim MyCookieColl As HttpCookieCollection
Dim MyCookie As HttpCookie

MyCookieColl = Request.Cookies
' Capture all cookie names into a string array.
arr1 = MyCookieColl.AllKeys
' Grab individual cookie objects by cookie name
For loop1 = 0 To arr1.GetUpperBound(0)
MyCookie = MyCookieColl(arr1(loop1))
Response.Write("Cookie: " & MyCookie.Name & "<br>")
Response.Write("Expires: " & MyCookie.Expires & "<br>")
Response.Write("Secure:" & MyCookie.Secure & "<br>")
Response.Write("Value:" & MyCookie.Value & "<br>")

' Grab all values for single cookie into an object array.
arr2 = MyCookie.Values.AllKeys
' Loop through cookie value collection and print all values.
For loop2 = 0 To arr2.GetUpperBound(0)
Response.Write("Value " & CStr(loop2) + ": " & arr2(loop2) & "<br>")
Next loop2
Next loop1
End Sub


When I call the ViewCookies mothod or routine, the only cookie I se is the one created by ASP.NET for the session identifier.

Can anybody tell me what i'm doing wrong here? I based my code in an example I got from MSDN. I'll appreciate your help.

Regards,

David Confused | :confused:
QuestionImport/Upload directory (URGENT!!!) Pin
Yong Yau26-Sep-06 16:32
Yong Yau26-Sep-06 16:32 
AnswerRe: Import/Upload directory (URGENT!!!) Pin
dgonzale26-Sep-06 16:46
dgonzale26-Sep-06 16:46 
GeneralRe: Import/Upload directory (URGENT!!!) Pin
Yong Yau26-Sep-06 18:02
Yong Yau26-Sep-06 18:02 
AnswerRe: Import/Upload directory (URGENT!!!) Pin
dgonzale27-Sep-06 3:07
dgonzale27-Sep-06 3:07 
GeneralRe: Import/Upload directory (URGENT!!!) Pin
Yong Yau28-Sep-06 19:33
Yong Yau28-Sep-06 19:33 
QuestionSerious Help with WSE(Web Service Enchanements) 3.0 [modified] Pin
Raj Sachdeva26-Sep-06 9:38
Raj Sachdeva26-Sep-06 9:38 
AnswerRe: Serious Help with WSE(Web Service Enchanements) 3.0 Pin
minhpc_bk26-Sep-06 20:02
minhpc_bk26-Sep-06 20:02 
Questionimages on gridview Pin
Britney S. Morales26-Sep-06 9:33
Britney S. Morales26-Sep-06 9:33 
AnswerRe: images on gridview Pin
Not Active26-Sep-06 11:00
mentorNot Active26-Sep-06 11:00 
GeneralRe: images on gridview Pin
Britney S. Morales26-Sep-06 11:49
Britney S. Morales26-Sep-06 11:49 
GeneralRe: images on gridview Pin
Not Active26-Sep-06 12:02
mentorNot Active26-Sep-06 12:02 
AnswerRe: images on gridview Pin
Bishoy Labib26-Sep-06 12:35
Bishoy Labib26-Sep-06 12:35 
QuestionNeed GetGlobalResourcesObject (the type+property version) Pin
User 178031526-Sep-06 9:25
User 178031526-Sep-06 9:25 
AnswerRe: Need GetGlobalResourcesObject (the type+property version) Pin
minhpc_bk27-Sep-06 2:33
minhpc_bk27-Sep-06 2:33 
GeneralRe: Need GetGlobalResourcesObject (the type+property version) Pin
User 178031527-Sep-06 2:55
User 178031527-Sep-06 2:55 
QuestionFormatting Dates in Form to Email Pin
hers2keep26-Sep-06 9:15
hers2keep26-Sep-06 9:15 
AnswerRe: Formatting Dates in Form to Email Pin
Guffa26-Sep-06 11:37
Guffa26-Sep-06 11:37 

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.