Where we can define global variable apart from Global.asax page? [Resolved]

Posted by Allemahesh under ASP.NET on 7/22/2013 | Points: 10 | Views : 1370 | Status : [Member] [MVP] | Replies : 3
Where we can define global variable apart from Global.asax page?




Responses

Posted by: Jitendrasoft09 on: 7/25/2013 [Member] [MVP] Starter | Points: 50

Up
0
Down

Resolved
Hi Allemahesh,

You can define static variable inside static class. Call that value in project anywhere using same namespace. You can change frequently values of MyGlobalValue as below code is mentioned.

public static class Globals

{
public static int MyGlobalValue ;
}


Refer below link for more information-
http://www.codeproject.com/Questions/167441/How-can-i-declare-public-variable-in-C-NET-like-va

Jitendra Kumar
If my post helps you, plz mark as an answer.

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ssj_Kumar on: 7/23/2013 [Member] Starter | Points: 25

Up
0
Down
Create a property class in App_Code which helps you to access global

Regards,
Jayakumar Selvakani

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Allemahesh on: 7/24/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
But I want to change these values frequently. If I change in app_code, then we need to build and upload the .ddl. I don't want to do that? Any other way?

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response