Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning to a different view
Message
General information
Forum:
ASP.NET
Category:
MVC
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01596244
Message ID:
01596621
Views:
42
Hi Viv, I figured it out eventually, I added another parameter to the HttpGet method
 [HttpGet]
        public ActionResult Edit(int id,string ReturnToView)
        {
            EmployeeEditOrCreate employee = MvcApplication.Client.GetEmployeeForEditing(id);
            EmployeeController.ReturnToView = ReturnToView;
            return View(employee);
        }
and in my ActionLink in the view I added this to the anonymous type
ReturnToView = System.Web.HttpContext.Current.Request.Url.ToString()

and in the HttpPost method

 return Redirect(ReturnToView);

ReturnToView is a static string Property of my Controller class
works like a charm, thanks to everybody who helped.
Regards,
Peter J. Kane



Pete
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform