I want to create a blog with sub-blogs. Each sub-blog would have it's own "theme" variable in the model which would alter the theme. I try to pass the theme variable to the _ViewStart.vbhtml page like so:
@Code
@((@ViewBag.Theme.length > 0) ? Layout = @ViewBag.Theme : Layout = "~/Views/Shared/_Layout.vbhtml") End Code
However, I get an error:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30201: Expression expected.
Source Error:
Line 5: *@ Line 6: Line 7: @((@ViewBag.Theme.length > 0) ? Layout = @ViewBag.Theme : Layout = "~/Views/Shared/_Layout.vbhtml") Line 8: Line 9: End Code
Source File: C:\Users\darchual\documents\visual studio 2010\Projects\GemcoBlog\GemcoBlog\Views_ViewStart.vbhtml Line: 7
How can I change templates, is there a better way?