asp.net changing website root
I am URL routing myself. Main project only contain the URL routing code. Different websites are placed on approot. e.g: I have deployed VS2010 test-default-website at approot/webTest/. I am trying to opening http://webTest/Account/Login.aspx from browser. For that URL request, I am serving page using PageParser.GetCompiledPageInstance(), as follows:
In URL route request handler,
return PageParser.GetCompiledPageInstance("webTest/Account/Login.aspx", HttpContext.Current.Server.MapPath("webTest/Account/Login.aspx"), HttpContext.Current);
I am getting following exception:
The file '/Account/webTest/Account/Login.aspx' does not exis开发者_StackOverflow中文版t.
PageParser.GetCompiledPageInstance is automatically appending '/Account' before the actual address, thus unable to find it. How can I make it not to append '/Account' ?
Thank you. Best Regards.
"webTest/Account/Login.aspx"
is a relative path, add a slash to beginning to make it absolute: "/webTest/Account/Login.aspx"
精彩评论