I have created a form using a surface controller. The form is working correctly, but i want to send the page name through the form. Can someone please tell how i should get this ?
Kind regards,
Jaco
using Marstrand.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Web;
using System.Web.Mvc;
using Umbraco.Web.Mvc;
namespace Marstrand.Controllers
{
public class ReserveerSurfaceController : SurfaceController
{
// GET: ReserveerSurface
public ActionResult Index()
{
return PartialView("ReserveerView", new ReserveerViewModel());
}
Use Page Name into form
I have created a form using a surface controller. The form is working correctly, but i want to send the page name through the form. Can someone please tell how i should get this ?
Kind regards, Jaco
using System; using System.Collections.Generic; using System.Linq; using System.Net.Mail; using System.Web; using System.Web.Mvc; using Umbraco.Web.Mvc;
namespace Marstrand.Controllers { public class ReserveerSurfaceController : SurfaceController { // GET: ReserveerSurface public ActionResult Index() { return PartialView("ReserveerView", new ReserveerViewModel()); }
}
Hi Jaco,
If your controller inherits from SurfaceController then you can access the current page name.
then in your action, something like
B.
Great, Thank you very much :):) That did the trick!
if you are trying to access it from within a partial, you can use:
Thank you very much!
is working on a reply...