I'm working with ASP Web Pages, in Visual Studio 2012. Im starting to make some test and one of those test ois to have global/sitewide variables used in files in the website project. The problem is that i cant and get an error when using the declared variable in a file on the project. Probably im missing something or i'm making a mistake.
The Code i have is the following File: _AppStart.vbhtml (is in the root of my website)
@Code
'Declaring Global Variables for the Application
Dim sitename As String = "Test Razor App"
End Code
File: App_Layout/defaultTheme/_header.vbhtml
<meta charset="utf-8" />
'<title>@sitename</title>
'<link rel="stylesheet" type="text/css" href="style.css" />
If i use the @sitename i get the error: 'sitename' is not declared. It may be inaccessible due to its protection level. If i use a text the project runs perfectly.
Im following the basic tutorial in http://www.w3schools.com/aspnet/webpages_global.asp
Any Help will be Good. Thanks in Advance.