gpt4 book ai didi

c# - 在 C# 中,我怎样才能使它像目录一样以 .aspx 结尾?比如 file.aspx/programtorun/

转载 作者:行者123 更新时间:2023-11-30 20:55:31 24 4
gpt4 key购买 nike

所以我一直在使用 php,然后切换到 ASP.NET,因为我喜欢它。无论如何...我一直在开发自己的网站等,但我一辈子都弄不明白!

我有什么:

string val = HttpContext.Current.Request["Header"];
// filename: index.aspx
// what I need to get
if (val == "random")
{
renderA.Random("randoms.html");
}
else
{
renderA.Index("index.html");
}

它在 URI 中返回的内容

/index.asp?random

我希望它看起来像:

/index.aspx/random/

有什么办法可以解决这个问题吗?

最佳答案

您应该考虑切换到 MVC 站点;它将为您提供所需的功能。

这是来自旧版本,但您会明白:Scott Guthrie talking about mvc framework

关于c# - 在 C# 中,我怎样才能使它像目录一样以 .aspx 结尾?比如 file.aspx/programtorun/,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18242237/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com