I’ve created a simple .NET MVC project, following the walkthrougth on MSDN.com.
I’m confused about how I’d go about adding a button to the page, so that I can map an action to it.
I’ve tried searching the web for this, but haven’t found what I’m looking for.
Does anyone know of any resources that could help me?
EDIT
The JS for the search bar is below.
<script type="text/javascript">
$(function () {
$('#search').MyApp('init');
$('#search').bind('selectItem', function (event, target) {
alert($(target).attr('data'));
});
// $.getJSON("http://localhost", {},
// function (x) {
// // var x = [1, 2, 3];
// alert("test");
// });
// alert('here')
});
</script>
Wha do I need to do to add a search button you can click?
you can it like this..
in your razor view
and in your controller you must define a action with that actionname that makes the logic