开发者

asp.net changing website root

开发者 https://www.devze.com 2023-02-05 06:38 出处:网络
I am URL routing myself. Main project only contain the URL routing code. Different websites are placed on approot.

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"

0

精彩评论

暂无评论...
验证码 换一张
取 消