Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > why why why does function not work

Reply
Thread Tools

why why why does function not work

 
 
Horace Nunley
Guest
Posts: n/a
 
      09-27-2006
I'm expecting this function to return the same value each time the page is
hit within the same session:
In other words i want to save the guid as a session variable

Function TempImageGUID() As String

Dim _Temp As String

If Not (Session("TempGUID") Is Nothing) Then

_Temp = Session("TempGUID")

Else

Session("TempGUID") = System.Guid.NewGuid().ToString()

_Temp = Session("TempGUID")

End If


Return _Temp

End Function


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      09-27-2006
The only reason I can see why it would not "work" is that the second code
block after the "Else" is the only one that's ever being executed.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"Horace Nunley" wrote:

> I'm expecting this function to return the same value each time the page is
> hit within the same session:
> In other words i want to save the guid as a session variable
>
> Function TempImageGUID() As String
>
> Dim _Temp As String
>
> If Not (Session("TempGUID") Is Nothing) Then
>
> _Temp = Session("TempGUID")
>
> Else
>
> Session("TempGUID") = System.Guid.NewGuid().ToString()
>
> _Temp = Session("TempGUID")
>
> End If
>
>
> Return _Temp
>
> End Function
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function pointer as template argument - does not work for function template avasilev C++ 4 12-22-2011 02:11 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Why does post or pre incremenent or decrement does not work inside a sizeof operator? Tarun C Programming 5 07-14-2005 03:58 PM
Why does this (very simple piece of) code does not work? jblazi Python 5 08-16-2004 01:30 PM
Webservice works once and then DOES NOT seem to work even though program does not crash Phi! ASP .Net Web Services 1 04-23-2004 08:42 AM



Advertisments