I'm definitely not a fan of WebForms, I prefer in the .NET world ASP.NET MVC.
Regardless, I'm working on a small part of a very large legacy WebForms application.
I'm integrating Korzh.com's EasyQuery.NET. to allow end users to create their own SQL queries based on pre-defined models made user friendly with aliases.
This is relevant because Korzh's demo uses Global.asax for its model and
query class along with Session.
Because the legacy WebForms application is very large, Global.asax in not used
for page specific items.
My solution was to use private static instead. static works well in desktop
applications but seems at the very least likely to cause some grief in WebForms applications.
I've discovered that !IsPostBack is not too reliable and it seems to me that
in WebForms the best practice may be to use Session. The problem with
Session is that it seems to be passed to the client with the HTML and can grow
very large in kilobytes.
QUESTIONS:
Since static variables reside on the IIS server when used with WebForms, does every user of a WebForms application share the same static variable address space? (I think the answer is yes).
What are the best practices/guidelines for using/not using static variables with ASP.NET WebForms applications?
Thank you.
Regards,
Gerry (Lowry)
P.S.: I could not find answers
via Google or searching SO.