Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Main Class of the Application
Message
From
14/10/2013 11:47:32
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01585436
Message ID:
01585446
Views:
48
>In the WinForms project I am converting to Web Forms there is a Main Class (MainClass.cs) which is the entry point of the application.
>In this class there are number of "public static string SomeName" properties declared (at the top of the class). Then the application sets the values of these properties based on user selection(s).
>
>In Web Forms there is a main page of the application but no main class (if I understand correctly). So I am thinking of creating a 'public sealed class' where to declare all these properties that WinForm MainClass declares.
>Does it make sense? Or is there a better place?

If the values are truly static (i.e. the same for all users) then a separate static class is probably the best way to go. Something like:
   public static class Globals
    {
        public static readonly int MaxInt = 10;
        public static readonly string SomeString = "This is the string";
    }
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform