Click here to Skip to main content
13,301,100 members (82,238 online)

Multiuser problem in

Dev.Vikas.S asked:

Open original thread
Dear friends,

Here, i've used public static string A; variable in my application.
Suppose, user1 hav A="1" and now user2 come to this form and he has A=2.
So, in this case original value of A for user1(which is A=1) replaced with user2(which is now A=2), But i want to keep both of the value saprately for both the users..

Note :
1) i used public string A; but during postback it lost its value.

i dont want to use session variable for this.

sample coding part for reference-->

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Data.SqlTypes;
using System.Data.SqlClient;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CrystalDecisions.Web;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;
public partial class PO_REG : System.Web.UI.Page
    public static string A; 
    public static string _print; 
    public void Page_Init(object sender, EventArgs e)
        if (_print == "P")
    protected void btnShowReport_Click(object sender, ImageClickEventArgs e)
        _print = "P";
        A = Rdbtn.SelectedValue;        
    private void ViewReport()
        ReportDocument crystalReport = new ReportDocument();
        if (A == "1")
        else if (A == "2")

any help would be highly appriciated....
thank you.
Tags: C# (C#4.0), ASP.NET


When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).

Advertise | Privacy |
Web03 | 2.8.171207.1 | Last Updated 26 Mar 2009
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100