Answered by:
Global variables handle

Question
-
User-665585339 posted
Hi Guys,
I had web service projects which consists of alot ASMX page, and recently i noticed that there is a SAME VARIABLES existing in ASMX page.
I understood that there is a way to put all those variables in global class files, but is there any other good way to handle that?
Kindly share :)
Tuesday, September 24, 2013 4:35 AM
Answers
-
User-386954757 posted
Hello
Just use Session state, or else just pass the data you need in the method calls.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, September 24, 2013 4:39 AM -
User-1360095595 posted
Application might be an option. Or maybe some config file.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, September 24, 2013 4:41 AM
All replies
-
User-386954757 posted
Hello
Just use Session state, or else just pass the data you need in the method calls.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, September 24, 2013 4:39 AM -
User-1360095595 posted
Application might be an option. Or maybe some config file.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, September 24, 2013 4:41 AM -
User753101303 posted
Hi,
It depends on how they are used rather than how they are named. Could they have a different value if both ASMX services are called at the same time ?
For example if they provide configuration values, base data for all services etc... the approach would be likely different. IMO we need to know first how they are used.
Tuesday, September 24, 2013 4:44 AM -
User-1623675128 posted
you can even try putting those values in singleton way and use the singleton in all ASMX within the project. so no duplication or no data inconsistency all ASMX will read same values.
just a thought.
Tuesday, September 24, 2013 6:41 AM