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.
<Prob 1: You need to comma-separate your list values. Need more info to give you exact code as I have no idea if this is asp.net or asp.net mvc or something else. If, say, this is redirecting to another action in asp.net mvc your receiver action param needs to be a List and you redirect to /Receiver?param1=value1,value2,value3 ...
Hopefully that answers your question
Prob 2: Cant redirect from an ajax request. Need to return something special and handle it on the front-end.
Prob1. Add a public property to current page with type List<Class>
. On the next page (target page of redirect()), add prevoiusPageType tag in ASPX file. Now you can access Page.PreviousPage.ListToAccess.
Prob2. Add false as param for redirect like Response.Redirect("<URL-of-target-page", false);
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]';