gpt4 book ai didi

c# - 更改 WebResource.axd URL

转载 作者:太空狗 更新时间:2023-10-29 23:35:23 28 4
gpt4 key购买 nike

ASP.NET 自动包含以下脚本标记:

<script src="/WebResource.axd?d=8H_C0aee9xE8e9a-3YoRhA2&amp;t=633413907763620168" type="text/javascript"></script>

但是,客户端站点正在通过另一个站点进行代理。所以他们网站根目录的 URL 是:

http://domain.com/somename/

因此我需要在 WebResource.axd 前加上/somename,这样生成的标签将如下所示:

<script src="/somename/WebResource.axd?d=8H_C0aee9xE8e9a-3YoRhA2&amp;t=633413907763620168" type="text/javascript"></script>

我不确定如何实际设置它?是否有我可以设置的 web.config 设置,以便它具有此前缀?

最佳答案

我认为这个函数 Response.ApplyAppPathModifier("You path"); 可以为您完成工作。

Global.asax

protected void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
string HereIsMyFileName = HttpContext.Current.Request.RawUrl;

if HereIsMyFileName contains the "webresource.axd"
then change it to what ever you like using
Response.ApplyAppPathModifier("You path");

希望这对您有所帮助。

关于c# - 更改 WebResource.axd URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2343264/

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