When you are creating a Search for your Website, you Want the user experience to be as good as anytime and when you are browsing your gridview you want to be able to press the Back Button to go back to the previous viewed page.
In asp.net with asp.net ajax it's possible when using the ScriptManager
+ Ajax Control Toolkit where there is a History Manager
.
Now, when you are using ASP.NET MVC, you Don't have the possibility to use the ScriptManager
because it needs to be nested in a server-runned form.
This sample code is used for a Basic search
<% using(Ajax.BeginForm("TestSearch",
new AjaxOptions { UpdateTargetId = "details" })) { %>
<%= Html.TextBox("search") %>
<input type="submit" value="search" />
<% } %>
When you press the Submit-button on a standard page, you will be posted to a different page, however, in this case, you Wont. So there is no History saved because the whole Web Page was not reloaded.
That's just the first problem.
Problem #2
Since the history is not saved, as proven above, the Search history of a textbox is not updated. A textbox history entry is only added when the page is fully postbacked, how do you solve that with asp.net mvc + ajax?