Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning to a different view
Message
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01596244
Message ID:
01596621
Vues:
44
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform