Reputation: 679
I have a c#/asp.net 4.0(not MVC) website where a user can search for various items. The search/results functionality works something like this:
On the search page the user fills out the search criteria(textboxes, dropdowns, etc...), and clicks a submit button. The on_click event handler does some validation and/or error checking. If everything checks out, I create an object to hold all the values and place the object into session. I then do a response.redirect to the results page. On the results page I read the object out of session and contact a wcf service and pass the object to it. The wcf does the search and returns the results(if any) and I display the results.
I was curious if there was a better way to do this. It works ok, but something doesn't feel right about it. I'm not too wild about loading the object into session.
I'd prefer to send the object(with the search criteria) to the wcf, then do a redirect, have the results page hold up loading until I get a response back from the wcf service. Once I get the results, back go ahead and load the page with the results.
Is this possible? Any feedback/links would be appreciated.
Also there won't be any third parties using our wcf service, this is all inhouse.
Upvotes: 0
Views: 341
Reputation: 364339
There are three ways how to do that
Server.Transfer
/ Server.Execute
.Upvotes: 2