|
by: Wayne |
last post by:
Hi,
I'm new to .NET and have a question about the use of static variables vs.
session variables in a web form in C#.
Instead of using a session variable to hold a string to persist during
datagrid paging. Can I use a static variable? Also, if I use a static
variable is that variable shared by everyone that brings up the aspx page?
Ex, if 4 people are viewing the aspx page is an instance of the static
variable created for each of the...
|
by: adam |
last post by:
Having spent nearly 2 years in win forms land the inevitable request came
for me to "do some web pages".
So being new to this bit of .net and having had a look around I can't see
where the best way to store session data.
1) use the (string)Session approach
Obviously bad for maintenance, readability etc.
2) have a typed MySession object with static properties for each value I
want to store
|
by: Just D |
last post by:
Hi,
How slowly is to work with these objects - Application and Session ? Is
it much better to create a huge project or some static library and place all
variables/constants there instead of many Session objects?
When I removed some of Session objects and replaced by another approaches
I got an illusion that application started working significantly faster? Is
it true?
|
by: Jason |
last post by:
Currently, I am storing information about the currently logged on user
in Session variables that are stored in SQL. However, I am using
role-based security, so I am storing custom roles in a GenericPrincipal
object that I attached to Context.User. My question is this:
Can I create a new class, ExtendedPrincipal for instance, and simply
inherit System.Security.Principal and store all of the information
currently stored in Session...
|
by: Randy |
last post by:
Hello,
I'm having a strange problem. I've got a .NET web app which uses Session
variables. Sometime, not all the time, they get cross threaded...that
is...one user will have another user's Session variable(s) data assigned to
them. I can't figure out why. I've read that other people are having this
problem too but I haven't found a resolution yet. Can someone please tell me
how I might go about fixing this?
Thanks
|
|
by: james |
last post by:
Hi
I am considering storing my session variables within one static object
with session scope. The static object will be a class with accessor
functions to get and set the equivalent session variables stored as
member variables. This will allow strong typing. Apart from the
problems of multithreading, are there any performance overheards of
which I should be aware?
Thanks
|
by: cobus.lombard |
last post by:
I have found it very easy to have a Helper class that has static
members which access Session Variables. For example:
public class HelperClass
{
public static doCustomer CurrentCustomer
{
get
{
if(HttpContext.Current.Session == null)
|
by: BillE |
last post by:
When a user opens a new IE browser window using File-New-Window the
integrity of an application which relies on session state is COMPLETELY
undermined. Anyone who overlooks the fact that File-New-Window creates an
instance of IE in the same process with the same SessionID as the parent
window is in big trouble. This fundamentally restricts the usefullness of
using session state management.
I probably missed it somewhere - can...
|
by: bharathreddy |
last post by:
Here I will given an example on how to access the session, application and querystring variables in an .cs class file.
Using System.Web.HttpContext class.
1) For accesing session variables : System.Web.HttpContext.Current.Session
2) For accesing Application variables : System.Web.HttpContext.Current.Application
3) For accesing QueryString variables : System.Web.HttpContext.Current.Request.QueryString
Here is a simple example where...
|
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...
|
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,...
|
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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,...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
|
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...
|