How to update querystring in C#?

后端 未结 11 1250
野的像风
野的像风 2020-12-02 12:06

Somewhere in the url there is a &sortBy=6 . How do I update this to &sortBy=4 or &sortBy=2 on a button click? Do I need to write custom string functions to creat

11条回答
  •  鱼传尺愫
    2020-12-02 12:59

    The only way you have to change the QueryString is to redirect to the same page with the new QueryString:

    Response.Redirect("YourPage.aspx?&sortBy=4")
    

    http://msdn.microsoft.com/en-us/library/a8wa7sdt(v=vs.100).aspx

提交回复
热议问题