Stylesheet CSS not loading with Context.RewritePath

barbilee

New Member
I am getting problem in loading stylesheet CSS with asp.net VB Context.RewritePath. My project is working on fly subdomain system. Means when we enter this in abcUser.mydomain.com then it will get default page of abcUser from mydomain.com/users/abcUser/default.aspx, without changing address bar's address. remember there is no any physical subdomain exists. in my project if user named folder exists then it load the default page from /users/< abcUser>/default.aspx.now if in browser i enter direct path \[quote\] eg: www.mydomain.com/users/< abcUser>/default.aspx\[/quote\]then it load css stylesheet, but if i enter path like this: \[quote\] eg: abcUser.mydomain.com\[/quote\]Then it load my default.aspx page but not loading css file
  • This is Global.asax Application_BeginRequest code:
.\[code\]If Directory.Exists(Server.MapPath("~/users/" & parameters(i))) Then Context.RewritePath("/users/" & parameters(i) & "/default.aspx", False) ReturnElse Context.RewritePath("/error.aspx") ReturnEnd If\[/code\]Parameters(i) variable contains the value entered in browser as subdomain eg: abcUser.
  • This is my folder structure:
9oCuf.png
  • This is my default.aspx page code:\[code\]<link href="http://stackoverflow.com/questions/15608212/StyleSheet.css" rel="stylesheet" />\[/code\]
Extra Detail: i installed new ASP.NET and Web Tools 2012.2 Update for microsoft.aspnet.friendly.urls LINK. and it is working as promised, my all new new and old web pages are now friendly. my project is asp.net 4 webform iis7
 
Top