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.
ex:System.Collections.Generic.List1[IDataEntities.ISearchResultsEntity]
Prob2:I have a method call in ajax post,I am able to navigate to the method but inside i have done response.redirect which fails saying “Threadabort exception”
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
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]';
Method 2
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.
Method 3
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);
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0