开发者

When i redirect to search page, can i fill the form (post method) in Response? It's possible? How?

开发者 https://www.devze.com 2023-02-18 13:00 出处:网络
When i catch a invalid URL, for example: www.example.com/urlDontExists , i redirect to the Search Page, like this:

When i catch a invalid URL, for example: www.example.com/urlDontExists , i redirect to the Search Page, like this:

Response.Redirect("/Search");

Bu i want to send the tag "urlDontExists", to the form, to see the same result like i went to the Search page, and searched by "urlDontExists".

I know it's possible with QueryString like:

Response.Redirect("/Search?searchtag=urlDontExists");

But i 开发者_如何学Godon't want in the QueryString

This it's possible?


You can use jQuery for that.

$(document).ready(function() {
    // Get the parameters and fill the search form here
    var location = window.location;
    // modify the querystring so that urlDoesntExist is removed from the titlebar
    ...
    window.location.replace(modified_url);
})

Note that this is a big hack.

0

精彩评论

暂无评论...
验证码 换一张
取 消