Class with global variables in Web Application Project

leooxd

New Member
I'm trying to migrate from the Web Site Project styleto use the Web Application Project instead. The App_Code folder is missing, and I have readthe reasons why, about compilation to .dll'sand so, and why I should not include and reference bothclasses and dll's. That is fine. It is recommended that I move my .vb classes from the App_Code or simplyrename the folder to "CodeFolder". I have now done that. But I am used to have a class named Globals.vbin the App_Code folder with global variables and functionswhich I can access throughout my entire site withoutinstatiation.My Globals.vb could for example look like:\[code\]Public Class Globals Inherits System.Web.HttpApplication Public Shared Path As String = ConfigurationManager.AppSettings("WebPath") Public Shared strSql as String Public Shared Function ConvertVBLineBreaksToHTML(Byval s as String) as string 'Code here End Function End Class\[/code\]And so on. How do I accomplish that with a WAP? And also, what about.xsd datasets in my previous App_Code folder which also were accessiblefrom anywhere?Best regards.
 
Back
Top