How to pass list as a parameter in response.redirect

后端 未结 3 2156
予麋鹿
予麋鹿 2021-01-26 10:28

Prob1:I have 2 lists which i want to access in the next page which i will be redirecting. Current result, When i pass my result, in the url it shows the List data type.

<
3条回答
  •  我在风中等你
    2021-01-26 11:10

    use Session to hold your list as below

    Session["mylist"] = list;
    

    you can access it from next page, there are many other ways. please check this link.

    when you call Response.Redirect call it as below

    Response.Redirect(url, false);
    Context.ApplicationInstance.CompleteRequest();
    

    but don't do Redirect on ajax call from server side, ones ajax call completed you can redirect from client side call.

    on success ajax call back method

    window.location = '[url to redirect]';
    

提交回复
热议问题