Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何避免母版页';s url重写_C#_Asp.net_Url Rewriting_Master Pages - Fatal编程技术网

C# 如何避免母版页';s url重写

C# 如何避免母版页';s url重写,c#,asp.net,url-rewriting,master-pages,C#,Asp.net,Url Rewriting,Master Pages,我的站点根目录中有一个母版页。 然后在另一个目录中,我有一个设置为使用此母版页的web表单 问题是当显示页面时,母版页中的所有URL都会被重写 例如: 母版页中的基本Url:“users.aspx” “其他”目录中网页的重写Url:“Other/users.aspx” 是否有保留基本URL的选项?不是URL被重写,而是您在母版页中使用相对路径。你可能在做这样的事情: <a href='users.aspx'>View users</a> 或 谢谢,实际上我正在使用t

我的站点根目录中有一个母版页。 然后在另一个目录中,我有一个设置为使用此母版页的web表单

问题是当显示页面时,母版页中的所有URL都会被重写

例如:

  • 母版页中的基本Url:“users.aspx”
  • “其他”目录中网页的重写Url:“Other/users.aspx”

是否有保留基本URL的选项?

不是URL被重写,而是您在母版页中使用相对路径。你可能在做这样的事情:

<a href='users.aspx'>View users</a>


谢谢,实际上我正在使用tilda,但它不起作用。我错过了runat=“server”,它现在可以工作了
<a href='/users.aspx'>View users</a>
<a href='~/users.aspx' runat='server'>View users</a>