asp.net - IE div, updatetargetid not refreshing on subsequent requests -


I have a problem when showing a partial view in the div with the updatetargetid property of Ajax.ActionLink. This is my controller -

  [handleError] Public class HomeController: controller {static numberview model model = new numberview model (); Public Performance Index () {model.IsDivisibleBy3 = (model.CurrentNumber% 3 == 0); If (Request.IsAjaxRequest ()) {return partial view ("ViewUserControl1", model); } See Return (); } [ActionName ("increase")] public performance increase () {model.CurrentNumber ++; Return Redirect Action ("Index"); }}  

view my index -

  & lt;% @ page language = "c #" masterpage file = "~ / view / share / site Muster "Inherits =" System.Web.Mvc.ViewPage "%> & Lt; Asp: Content ID = "Content1" content placeholder ID = "TitleContent" runat = "server" & gt; Home page & lt; / Asp: Content & gt; & Lt; Asp: Content ID = "Content2" content placeholder id = "main content" run = "server" & gt; & Lt; Script type = "text / javascript" & gt; ShowResult () {var window height = document documentElement.clientWidth; Var windowhit = document.documentElement.clientHeight; LeftVal = (windowWidth - 655) / 2; Topwal = (WindowHight - 200) / 2; $ ('# Result'). CSS ({"left": leftVal, "top": topVal}); $ ('# Background') fadein ("slow"). } & Lt; / Script & gt; & Lt; Div id = "background" class = "hiddenDiv" & gt; & Lt; Div id = "results" square = "popup box" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt;% = Ajax.ActionLink ("Show", "Index", New Ajax Option () {UpdateTargetId = "Result", Concept = "ShowAulault", htmlm = "go"})%> & Lt;% = Html.ActionLink ("increase", "increment")%> & Lt; / ASP: Content & gt;  

It works in FF but not in IE 6-IE8.

IE scenario- So when I click on 'show', for the first time it shows that '0 is divisible by 0' If click 'Berenment', then the number is now 1 and is not divisible by 3. Now if I click on 'show' it shows that 0 'is divisible by 3'

VS After placing debug points in, I found - the second time the request does not go to the server at all. The result of not updating the Updatetargetid div

Does anyone face this issue before this?

That's to cache the duplicate request, just add it to your action method:

< Pre> Response.CacheControl = "no-cache"; (Guid.NewGuid ()) ToString ()) Response.Cache.SetETag;

So that you have:

  [ActionName ("increase")] Public action increase () {Response.CacheControl = "no-cache"; (Guid.NewGuid ()) ToString ()) Response.Cache.SetETag; Model.CurrentNumber ++; Return Redirect Action ("Index"); }  

Comments