Shared code

  • Thread starter Thread starter Tumurbaatar S.
  • Start date Start date
T

Tumurbaatar S.

I need to put a frequently used (by almost all pages in web app) code
in some place. May be as static method in Global.asax. Is it a right way?
 
I need to put a frequently used (by almost all pages in web app) code
in some place. May be as static method in Global.asax. Is it a right way?

You could place the code in Global.asax or, alternatively, place it in a
separate class file...
 
narmally Global.asax is used to implement for application level events.
but here for u r senario think the scope of the code is for object level (
for each request or for each session ) or application level.

if application level create a separate class and write static members then
access.
if session level create a separate class and write reference members then
access it.

Kota.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top