Reputation: 927
I am currently working on classic asp application and we have URL rewrite pages.
In those pages, we have small form which I have to validate. When I press the submit button it validates the page but change the URL of the page.
I want to stop changing URL.
I had same issue with ASP.NET C# so I used Form1.Action = Request.RawUrl;
How can I do same with classic asp application?
Upvotes: 1
Views: 757
Reputation: 8461
The equivalent of Request.RawUrl
is
dim myUrl
myUrl = Request.ServerVariables("URL")
So
<Form action=<%=myUrl%> 'and the rest of the details
However, the Request.ServerVariables("URL")
doesn't include the querystring
(if present).
If you need that, then you'll have to build it manually, do something like
dim myUrl
myUrl = Request.ServerVariables("URL") & "?" & Request.QueryString
(you may want to put in an if else statement to make this cleaner).
Upvotes: 1