c# 4.0 - What is the best practise of declaring the Variables in Asp.Net Programming? -


i want know declaration of variables in separate class file or declaring in same aspx.cs file.please tell me best practise of declaring variables.

thanks in advance

its practice separate business logic presentation. if variables talking related presentation only, can:

  • declare page level variables @ beginning of class , surround them region tag(as rightly mentioned slugster)
  • declare local variables close place first used possible(this cover chaospandion's point.

all other variables should fall category of business logic , should declared in class file containing business logic.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -