古詩詞大全網 - 成語查詢 - asp中response.redirect的用法

asp中response.redirect的用法

ASP中的response.redirect說明和用法:

1、asp中redirect方法是將瀏覽器重定向到另壹個URL,而不是將內容發送給用戶。

2、Response.Redirect 語句放在頁的頂部和<HTML>標記之前,確保沒有任何內容返回給瀏覽器。如果在返回給瀏覽器的內容或標題後使用 Response.Redirect,會出現錯誤信息。

3、如果要在頁面輸出信息,並進行跳轉,可以使用response.write 和js代碼的結合;

比如:

response.write "<script type='text/javascript'>alert('內容提交成功!');location.href='要跳轉的網址url';</script>"