Any Asp.net or Asp.net MVC template based system? -


Is a template based system available on the net? I have several domains that I want them to use the same system. Each domain can have different designs but all will be managed through the same management system.

Believing that you want your app to be based on host name (domain name) Dynamically select CSS and Picture Folders, so that you can brush your app based on the domain name, you can do something like this:

  Skin of public stable class {public static string URL (String asset path) {var host = System.Web.HttpContext.Current.Request.Url.Host; Switch (host) {case "www.myfirstsite.com": return UrlPath ("~ / content / myfirst /" + assetPath.TrimStart ('/')); The case "www.theothersite.com/": return UrlPath ("~ / content / theother /" + assetPath.TrimStart ('/')); Default: Return UrlPath ("~ / content / default /" + assetPath.TrimStart ('/')); }} Private static string UrlPath (Virtual Path String) {return VirtualPathUtility.ToAbsolute (virtualPath); }}  

When referring to CSS and images, all your ideas will see something like this:

  & lt;% @ Page language = "C # "Inherits =" System.Web.Mvc.ViewPage "%> & Lt ;; DOCTYPE HTML PUBLIC "- // W3C // DTT XHTML 1.0 Transcription // N" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Head runat = "server" & gt; & Lt; Title & gt; My page & lt; / Title & gt; & Lt; Link rel = "stylesheet" type = "text / css" href = "<% = Skin.Url (" css / master.css ")%>" / & Gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Img src = "& lt;% = Skin.Url (" images / myimg.gif ")%>" Alt = "myimg" /> & Lt; / Body & gt; & Lt; / Html & gt;  

Comments