简体   繁体   中英

Want to ASP classic page without HTML to be not shown

In my scenario, I have an ASP classic page that is being called. I want that to not show to the user the ASP classic page. The ASP classic page only has VBScript code, I think this could ease solving this issue. Any idea will be helpful.

What should the enduser see? If the page is being called by a user-interaction the enduser expects something back from the browser. If you don't want to show an empty page, you should at least redirect to the homepage but a page with more usefull information about the user-interaction would probably be better.

Anyway, you can use either response.transfer or response.redirect to do the redirect. Response.transfer is a redirect on the server-side, response.redirect on the client-side.

It does sound like it should be done using ajax calls. One thing you can do is post an additional value to your asp page and on that 2nd asp page test for the value or response.redirect to some other page.

Let's say you are sending values to page2.asp like page2.asp?data1=abc&data2=xyz. You can change that to page2.asp?data1=abc&data2=xyz&specialkey=hawks

Then on your page2.asp at the top of the page insert the code

if request("specialkey")<>"hawks" then
    response.redirect("home.asp")
end if

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM