Razor web pages: How do I create variable that is available to all pages?
问题 I have a lot of pages that is using the same variables. I would like to create these in a single page so I dont have to type them over and over again. How do I do this? I tried both _appStart.cshtml and _PageStart.cshtml, but when i run my content page i get error "the name selectedData does not exist in the current context" Here is my _PageStart.cshtml: (tried _appstart.cshtml too) @{ var db = Database.Open("razortest"); var selectQueryString = "SELECT * FROM tbl_stasjon ORDER BY nr"; var