Question

I have a form defined thus in a razor file.

@using (Html.BeginForm())
{

}

Within this form I have fields such as

<input type="text" readonly="readonly" name="MaxBudget" value="Any" id="SearchMaxBudget">

and a couple of structures like

<div class="ui-widget-content" style="height: 100px; width: 200px; overflow: auto;" id="amenitiesLog"><div>Hair dryer and shaving adaptor</div><br></br><div>Airport shuttle service</div><br></br></div>

I'd like to take the data from these fields and structures and pass them to the controller when I hit this button

<input type="button" class="btn-leftsearch" />

What bits am I missing and how can this be acheived?

Thanks,

Was it helpful?

Solution

In simple terms you need to create a model of your data, pass that into the view from the controller and then set up an action in the controller to receive the data.

There are plenty of good tutorials on this - one I found particularly helpful was http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3 but there are plenty - Uncle (or Aunt) Google is a great friend for this.

Good luck and happy reading.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top