【问题标题】:URL Rewrite , url change on postback eventURL 重写,回发事件的 url 更改
【发布时间】:2013-04-05 17:08:30
【问题描述】:

我目前正在开发经典的 asp 应用程序,我们有 URL 重写页面。

在这些页面中,我们有小表格,我必须对其进行验证。当我按下提交按钮时,它会验证页面,但会更改页面的 URL。

我想停止更改 URL。

我在使用 ASP.NET C# 时遇到了同样的问题,所以我使用了Form1.Action = Request.RawUrl;

如何使用经典的 asp 应用程序做同样的事情?

【问题讨论】:

  • 只需将表单的操作更改为指向同一页面,看不到您卡在哪里抱歉..

标签: c# asp-classic vbscript


【解决方案1】:

Request.RawUrl 的等价物是

dim myUrl
myUrl = Request.ServerVariables("URL")

所以

<Form action=<%=myUrl%> 'and the rest of the details  

但是,Request.ServerVariables("URL") 不包括 querystring(如果存在)。

如果需要,则必须手动构建它,例如

dim myUrl
myUrl = Request.ServerVariables("URL") & "?" & Request.QueryString

(您可能需要添加 if else 语句以使其更清晰)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-06
    相关资源
    最近更新 更多