【问题标题】:IIS with VBNet Aspx, how to setup/config a site (programmatically or not) to have a folder带有 VBNet Aspx 的 IIS,如何设置/配置站点(以编程方式或非编程方式)以拥有文件夹
【发布时间】:2018-07-08 20:16:39
【问题描述】:

我有 IIS,使用带有 VBNet 的 Aspx。

我有一个网站。 mystockmarketeg.com

我有很多关于市场资产的页面,例如我用 ?和 cod=THEASSET 更改我要显示的页面,例如:

mystockmarketeg.com?myinsidepage.aspx?cod=ASSET1
mystockmarketeg.com?myinsidepage.aspx?cod=ASSET2
mystockmarketeg.com?myinsidepage.aspx?cod=ASSET3

只需更改 cod 参数即可访问不同的页面。

但我认为这在 google 上表现不佳。

所以我想要一个这样的网址:

mystockmarketeg.com/ASSET1
mystockmarketeg.com/ASSET2
mystockmarketeg.com/ASSET3

有没有办法在 ASPX VBNEt 中以编程方式或更改 ISS 上的某些属性来做到这一点,而无需创建文件夹并将索引页放在每个文件夹上?

【问题讨论】:

  • 是的。如果您研究“asp.net 路由”,您会发现大量有关如何完成此操作的文档。

标签: asp.net vb.net iis directory


【解决方案1】:

配置ASP.NET Routing 来实现这个结果。请注意,如果您有包含动态 URL 的超链接,则应使用 <%$RouteUrl:...parameters...%> 生成 URL。

另见detailed ASP.NET Routing description

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-11-07
    • 2015-09-24
    • 1970-01-01
    • 1970-01-01
    • 2011-04-06
    • 1970-01-01
    • 2010-09-30
    相关资源
    最近更新 更多