I've designed a regular model dialog, the modal dialog contains :
-Find link
-Partial View (to show the returned results).
To illustrate my problem, you'll find in the RouteValues I'm posting the current time in seconds. Everytime I click, I get the same result.
@Ajax.ActionLink("Find", "PopulateResults", "Contract", new { kind = DateTime.Now.Second },
new AjaxOptions
{
UpdateTargetId = "results",
HttpMethod = "POST",
InsertionMode = InsertionMode.Replace,
LoadingElementId = "progress"
}, new
{
@class = "button",
id = "FindButton"
}
)
The controller gets the kind value and pass it to the partial view
[HttpPost]
[OutputCache(NoStore = true, VaryByParam = "", Duration = 0)]
public ActionResult PopulateResults(int kind)
{
return PartialView("PopulateResults", kind);
}
As I said, the value is always cached and it's not updated.
Update: Originally, I don't really want to post the current time and show it in the Partial View. In my modal dialog I have a textbox which is used for filtering the returned results. Actually, what happens, is that the value of the textbox is always cached.
I'm posting the current time in seconds
You are not posting the current time. You are posting the time (actually not the time but only the second) that was when the server rendered this page. If you want to post the current time use the client time.