开发者

Rootlevel http module unable to understand the master page path in the virtual directory

I have a http module at root level which resolves to the virtual directory which is a .net application on some conditions as below.

I need the have the httpmodule at root level only for some requirements.

application.Context.RewritePath("/virtualdirecotry/root/pages/sample/sample.aspx", String.Empty, "");

the sample.aspx page uses a master page as below

<%@ Page Language="C#" MasterPageFile="~/Root/Pages/Master/Site.Master"

as it uses the relative path the http module is unable to understand the path and throwing following error

The file '/Root/Pages/Master/Site.Master' does not exist.

error occurred during the parsing of a resource required to service this request. Please review the following specific pars开发者_开发百科e error details and modify your source file appropriately.

anyhelp will be appreaciated.

thanks.


I would create this page without using a master page:

/virtualdirecotry/root/pages/sample/test.aspx

On the page directive set trace="true" and then look for the executing path. My feeling though is that

~/Root/Pages/Master/..

Should actually be

~/Virtualdirecotry/Root/Pages/Master...

Either way if you use trace you can find out your executing directory and adjust the path as necessary.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜