[Mono-aspnet-list] How to force Mono to use TEMPDATA in RedirectToAction in same response

Andrus kobruleht2 at hot.ee
Tue Oct 16 16:26:51 UTC 2012


If ASP.NET MVC2 code below shows Test in Create controller response.

In Mono message does not appear in Create view.
It appears in next response invoked after create.

How to dorce Mono to show TempData value in same request like in ASP.NET ?


[HttpPost]
public RedirectToRouteResult Create()
{
TempData["Message"] = "Test";
return RedirectToAction("Index");
}


public ActionResult Index() {
  return View();
  }
 

Site.Master.

 

<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>

<!DOCTYPE html>
<html>
<head runat="server">
    <script src="<%= Url.Content("~/Scripts/jquery/jquery-1.7.1.js")%>" type="text/javascript"></script>

<% if (TempData["Message"]!=null) {
        %>
    $(function() {
        setTimeout( function() {
           showMessage ( '<%= TempData["Message"] as string %>');
           }, 300 );
      });
        <% } %>
    </script>
</head>
Andrus.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20121016/a2adbabf/attachment.html>


More information about the Mono-aspnet-list mailing list