Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Shared declaration. Is it always Global to all apps
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00827095
Message ID:
00827735
Vues:
11
Mark,

I would use session objects as I posted earlier instead.

>Thanks Cathi
>
>Does this mean I should not use shared propeties to pass information between postbacks?
>These shared properties remain in scope just fine, but I dont want them to be in scope for each browser instance.
>
>
>>Hi Mark,
>>
>>ASP.NET is stateless in nature and therefore any information you need to retain after a page is refreshed needs to be stored explicitly. One way to save information is by using session state. You would assign a value or object to a session variable:
>>
>>
>>Session["myvar"] = "my string";
>>
>>
>>>Hello
>>>
>>>I working on my first ASP.net VB web form.
>>>
>>>My page is making use of some objects that vanish from scope unless I make them shared.
>>>
>>>However another programmer in my dept did this and he says that the shared variables ended up in scope for every instance of the application that was open.
>>>
>>>I just want all the procedures in my web page to have access to a single application specific and not interfere with other instances of my app.
>>>
>>>AS you can see I am very new to all this :)
>>>
>>>
>>> Protected WithEvents Label12 As System.Web.UI.WebControls.Label
>>> Protected WithEvents Textbox1 As System.Web.UI.WebControls.TextBox
>>> Protected WithEvents ReviewButton As System.Web.UI.WebControls.Button
>>>
>>> Public objSess As New clsGetData_sess() ' Create the session object for this page
>>> Protected WithEvents txtSystemTitle As System.Web.UI.WebControls.TextBox
>>> Public oApp As Object
>>> Public Shared oBizApp As Object 'DPBIZ.AppData()
>>> Public Shared oAppRow As DataRow
>>>
>>>
>>>Do I have to persist everything through sessions or what.
>>>
>>>
>>>Confused of Brighton Uk
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform