Hi. I'm new to Umbraco 7. I created a contact form using the Creating Forms documentation. It worked.
Now I'm trying to create a subject field of type select with some options from the controller.
My controller:
public class ContactFormController : SurfaceController
{
public ActionResult Index()
{
var theOptions= new List<SelectListItem>
{
new SelectListItem() {Text = "Option 1", Value = "1"},
new SelectListItem() {Text = "Option 2", Value = "2"},
new SelectListItem() {Text = "Option 3", Value = "3"}
};
ViewBag.DdlSubject = theOptions;
}
[HttpPost]
public ActionResult Submit(...)
{
etc... (it works)
}
}
Creating Forms with select field
Hi. I'm new to Umbraco 7. I created a contact form using the Creating Forms documentation. It worked.
Now I'm trying to create a subject field of type
select
with some options from the controller.My controller:
And my partial view:
But the Index method of my controller is never hit. What am I missing?
Thanks in advance.
is working on a reply...