Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rahul 3 posts 73 karma points
    Jan 27, 2016 @ 07:14
    Rahul
    0

    Umbraco + MVC page Redirect with data

    I want to redirect to other Umbraco page with model data.

    Currently i am just redirecting to other Umbraco page but not with model data.

     public ActionResult CNOReplacement(MasterViewModel Model)
            {
                ViewBag.TestData = "Testing ViewBag data passing !!";
                return RedirectToUmbracoPage(1098);   
            }
    

    Even i have tried by passing viewmodel but that is also not working.

  • Dave Woestenborghs 3504 posts 12134 karma points MVP 9x admin c-trib
    Feb 04, 2016 @ 07:08
    Dave Woestenborghs
    1

    Hi Rahul,

    To pass data between different pages in ASP.NET MVC you need to use TempData instead of viewbag.

    https://msdn.microsoft.com/en-us/library/dd394711(v=vs.100).aspx

    Dave

Please Sign in or register to post replies

Write your reply to:

Draft