Ask a Question related to ASP.NET General, Design and Development.
-
yop #1
Variable & storing
Hello
I have an application, Login page, enter UserName &
Password.
Function in Users called GetUserDetails and checks the
details and if they are valid calls a function to fill
the following in the class component called
Public Class UserDetails
Public UserID As Integer
Public UserName As String
Public FullName As String
Public Email As String
End Class
So I would have thought now that what ever page I goto
that I could retreive the email or fullname from the
class above without having the call the GetUserDetails.
I use the following code.
'Load the User Name textbox
Dim userDetails As New
ASPNET.ASSETREGISTER.UserDetails()
msgfullname.Text = " Logged In: " &
userDetails.FullName
But it does not fill it, any ideas?
thanks in advance
yop Guest
-
storing and changing an external variable
Hello... Sorry for this question, but I am trying something new to me. I need to hold a couple of variables in an outside file that can be... -
Storing value from XML into a variable
There is a combo-box by the name "cbJobs" and it gets its value from the XML file named "data.xml".. I want to store the value transferred from this... -
Storing link text to a Cookie or Session Variable
Another one of those "It sounds easy enough to do, but...." I need to store the value/text displayed as a hyperlink to either a Cookie or Session... -
storing quotes into a variable
I think you just have to escape every double quote that you want to be a part of the HTML code like this --> /" That should work. I dont think... -
[PHP] storing quotes into a variable
$perf_mod = '<a href="#" onclick="popWindow(\'popup.php\')'; using \ to escape the ' \ escapes special characters. See the manual. Regards ... -
Cowboy \(Gregory A. Beamer\) #2
Re: Variable & storing
Once you fill the object, where are you storing it? In session? Serialized
to disk? Not at all?
Since you are simply creating a group of properties/fields a struct might be
a better option, but you still have to store it:
Dim MyClass As UserDetails = new UserDetails()
'lines to fill class here
Session("MyClass") = MyClass
To use:
Dim MyClass as UserDetails = CType(Session("MyClass"), MyClass)
You could make a static class to hold the variables, but you could only have
one user at a time. Then, your code would work without saving the object
off.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge
************************************************** **************************
****
Think Outside the Box!
************************************************** **************************
****
"yop" <aidangill@oceanfree.net> wrote in message
news:065101c35287$2bb01b10$a601280a@phx.gbl...> Hello
>
> I have an application, Login page, enter UserName &
> Password.
> Function in Users called GetUserDetails and checks the
> details and if they are valid calls a function to fill
> the following in the class component called
>
> Public Class UserDetails
> Public UserID As Integer
> Public UserName As String
> Public FullName As String
> Public Email As String
> End Class
>
> So I would have thought now that what ever page I goto
> that I could retreive the email or fullname from the
> class above without having the call the GetUserDetails.
>
> I use the following code.
>
> 'Load the User Name textbox
> Dim userDetails As New
> ASPNET.ASSETREGISTER.UserDetails()
> msgfullname.Text = " Logged In: " &
> userDetails.FullName
>
> But it does not fill it, any ideas?
> thanks in advance
Cowboy \(Gregory A. Beamer\) Guest
-
yop #3
Re: Variable & storing
Ok to be honest I am not sure where they are stored, in
the class.
The class is not been stored in the session. I do not
realise that you could to be honest
thanks
session? Serialized>-----Original Message-----
>Once you fill the object, where are you storing it? Inproperties/fields a struct might be>to disk? Not at all?
>
>Since you are simply creating a group ofMyClass)>a better option, but you still have to store it:
>
>Dim MyClass As UserDetails = new UserDetails()
>'lines to fill class here
>Session("MyClass") = MyClass
>
>To use:
>Dim MyClass as UserDetails = CType(Session("MyClass"),you could only have>
>You could make a static class to hold the variables, butsaving the object>one user at a time. Then, your code would work without*******************>off.
>
>--
>Gregory A. Beamer
>MVP; MCP: +I, SE, SD, DBA
>Author: ADO.NET and XML: ASP.NET on the Edge
>
>************************************************* ***************************>****
>Think Outside the Box!
>************************************************* ********>****
>"yop" <aidangill@oceanfree.net> wrote in message
>news:065101c35287$2bb01b10$a601280a@phx.gbl...>>> Hello
>>
>> I have an application, Login page, enter UserName &
>> Password.
>> Function in Users called GetUserDetails and checks the
>> details and if they are valid calls a function to fill
>> the following in the class component called
>>
>> Public Class UserDetails
>> Public UserID As Integer
>> Public UserName As String
>> Public FullName As String
>> Public Email As String
>> End Class
>>
>> So I would have thought now that what ever page I goto
>> that I could retreive the email or fullname from the
>> class above without having the call the GetUserDetails.
>>
>> I use the following code.
>>
>> 'Load the User Name textbox
>> Dim userDetails As New
>> ASPNET.ASSETREGISTER.UserDetails()
>> msgfullname.Text = " Logged In: " &
>> userDetails.FullName
>>
>> But it does not fill it, any ideas?
>> thanks in advance
>
>.
>yop Guest
-
Cowboy \(Gregory A. Beamer\) #4
Re: Variable & storing
When you load a class, it goes out of scope as soon as the page finishes
processing. If you try to pull that class on another page, it has no values,
as it is a new instance.
If you want to use an object across multiple pages, you need to store it
somewhere. Using Session is the easiest method, but you can serialize the
object and create your own engine, if there is some reason session is
unusable. Recreating the wheel is a pain, however, so I would stick to
Session before rewriting the mechanism.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge
************************************************** **************************
****
Think Outside the Box!
************************************************** **************************
****
"yop" <aidangill@oceanfree.net> wrote in message
news:0bc201c352b8$ab1eac00$a301280a@phx.gbl...> Ok to be honest I am not sure where they are stored, in
> the class.
> The class is not been stored in the session. I do not
> realise that you could to be honest
>
> thanks
>
>> session? Serialized> >-----Original Message-----
> >Once you fill the object, where are you storing it? In> properties/fields a struct might be> >to disk? Not at all?
> >
> >Since you are simply creating a group of> MyClass)> >a better option, but you still have to store it:
> >
> >Dim MyClass As UserDetails = new UserDetails()
> >'lines to fill class here
> >Session("MyClass") = MyClass
> >
> >To use:
> >Dim MyClass as UserDetails = CType(Session("MyClass"),> you could only have> >
> >You could make a static class to hold the variables, but> saving the object> >one user at a time. Then, your code would work without> *******************> >off.
> >
> >--
> >Gregory A. Beamer
> >MVP; MCP: +I, SE, SD, DBA
> >Author: ADO.NET and XML: ASP.NET on the Edge
> >
> >************************************************* ********> *******************> >****
> >Think Outside the Box!
> >************************************************* ********> >****
> >"yop" <aidangill@oceanfree.net> wrote in message
> >news:065101c35287$2bb01b10$a601280a@phx.gbl...> >> >> Hello
> >>
> >> I have an application, Login page, enter UserName &
> >> Password.
> >> Function in Users called GetUserDetails and checks the
> >> details and if they are valid calls a function to fill
> >> the following in the class component called
> >>
> >> Public Class UserDetails
> >> Public UserID As Integer
> >> Public UserName As String
> >> Public FullName As String
> >> Public Email As String
> >> End Class
> >>
> >> So I would have thought now that what ever page I goto
> >> that I could retreive the email or fullname from the
> >> class above without having the call the GetUserDetails.
> >>
> >> I use the following code.
> >>
> >> 'Load the User Name textbox
> >> Dim userDetails As New
> >> ASPNET.ASSETREGISTER.UserDetails()
> >> msgfullname.Text = " Logged In: " &
> >> userDetails.FullName
> >>
> >> But it does not fill it, any ideas?
> >> thanks in advance
> >
> >.
> >
Cowboy \(Gregory A. Beamer\) Guest



Reply With Quote

