I'm new with Umbraco and I'm now trying to develop a contact form for my website. Through the research I did so far I know I have to work with the surface controllers. I'm using Webmatrix and the Umbraco backoffice to develop my website, is it mandatory to use VS to work with surface controllers? All the tutorials and information I've found so far used only VS, so if I need to use VS how to do the migration of the code?
Personally I find it much easier to create a website in VS over Webmatrix, mainly because of all the helper methods and debugging tools available.
Saying that, you can create a surface controller in WebMatrix, I've just done it.
Simply create a folder for your controllers, then create a CS file. Webmatrix will ask you to put it in app_code but I don't believe you have to actually do that.
Then paste the following code:
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using Umbraco.Web.Mvc;
/// <summary>
/// Summary description for MySurfaceControler
/// </summary>
public class MySurfaceController : SurfaceController
{
public ActionResult Index()
{
return Content("hello world");
}
}
There you have it, the basics of a surface controller in WebMatrix.
Create a Contact Form
Hi guys,
I'm new with Umbraco and I'm now trying to develop a contact form for my website. Through the research I did so far I know I have to work with the surface controllers. I'm using Webmatrix and the Umbraco backoffice to develop my website, is it mandatory to use VS to work with surface controllers? All the tutorials and information I've found so far used only VS, so if I need to use VS how to do the migration of the code?
Thanks!
Hi Nelson,
Personally I find it much easier to create a website in VS over Webmatrix, mainly because of all the helper methods and debugging tools available.
Saying that, you can create a surface controller in WebMatrix, I've just done it.
Simply create a folder for your controllers, then create a CS file. Webmatrix will ask you to put it in app_code but I don't believe you have to actually do that.
Then paste the following code:
There you have it, the basics of a surface controller in WebMatrix.
is working on a reply...