Last post Jul 26, 2014 09:05 AM by Bainu
Jul 26, 2014 04:46 AM|Bainu|LINK
i developed a website and uploaded it on the internet. but, i encountered a huge problem. i needed to show user some data according to the data they entered. i thus need to store average amount of data for each user who is using the website (each user has
different data). i also need to pass these variable as parameters from on page to another(one is an aspx.cs page and one is a class i.e. .cs page) and from one function to another. for this i took all the variables as static (this was the problem). when multiple
users uses the website, the user's data who was initially using the website got overwritten by the new user's data. thus i tried to remove the static variables and took simple public but global variables. but now the value in the global variables is being
0(in case of int) or null(in case of string) for another button click even on the same page.
can u tell me how can i store all the different data for different users on the website.....
Jul 26, 2014 05:10 AM|MetalAsp.Net|LINK
Session is the easiest solution.
Jul 26, 2014 05:35 AM|Bainu|LINK
can u please explain in brief how to use it....like how to declare an int or a string for this purpose
Jul 26, 2014 06:02 AM|MetalAsp.Net|LINK
Session["key"] = yourVariable or value;
Then you can use: Session["key"] and cast it to the type of the value stored.
Jul 26, 2014 09:05 AM|Bainu|LINK
thank you very much MetalAsp.Net..................you solved my biggest problem :-)