ASP.NET Web Form parameters in URL

后端 未结 4 684
眼角桃花
眼角桃花 2021-01-19 16:22

I have an ASP.NET page that contain a form that search the page.

Is there any solution so that I can have the search text in the URL?

I want to give the posi

4条回答
  •  感动是毒
    2021-01-19 16:50

    You can also use jQuery to do the trick, like this:

    $(function(){
    
    $('input[type="submit"]').click(function(e){
           e.preventDefault();
           var searchResult = "Search.aspx?q=" + $('input#textbox').val();
           $('form#myForm').attr('action',searchResult);
        });
    });
    

提交回复
热议问题