Hi there everyone (love the fact of it being the friendliest community 🙂)
Very new with Umbraco and have come across a scenario which I think should be easy for someone here.
I have created a view (could also be a partial in other scenarios). For simplicity I have a text box and a button.
My code
@using(Html.BeginUmbracoForm<HelloWorld>("Greet", FormMethod.Post))
{
<Input type="text">
<Button type="submit">Submit</button>
}
My controller has the method
Public void Greet(string Name)
....
....
Even I click the button, the parameter Name is always empty? How could I pass that value from the textbox with a button click?
Pass value from form to method
Hi there everyone (love the fact of it being the friendliest community 🙂)
Very new with Umbraco and have come across a scenario which I think should be easy for someone here.
I have created a view (could also be a partial in other scenarios). For simplicity I have a text box and a button.
My code
Even I click the button, the parameter Name is always empty? How could I pass that value from the textbox with a button click?
Dean
You could try and add
name="Name"
to your input type. This way you should see the value in debug mode.is working on a reply...