net mvc 5 application and for this I use bootstrap because it looks fine.
I don't want to use for an input and a searchbutton the
@using (Html.BeginForm("...
Can I control the html tags without this from my controller. For example here is my index.cshtml
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="container">
<div class="row">
<h2>Suche</h2>
<div id="custom-search-input">
<div class="input-group col-md-12">
<input type="text" class=" search-query form-control" placeholder="Search" />
<span class="input-group-btn">
<button class="btn btn-danger" type="button">
<span class=" glyphicon glyphicon-search"></span>
</button>
</span>
</div>
</div>
</div>
</div>
I want if I click on the Searchbutton I get a message with the text from the inputfield.
Here is the Controller:
public ActionResult Search(string value)
{
//listofUsers is a arraylist of all users that found^^
return View(listofUsers);
}
How I can do this? :)
nameattributes of input elements.<form>. But since for some unknown reason you don't want to use the tool that is designed for this purpose you will need to write javascript to wire the sending of the data to the server. You can use AJAX or make a standard redirect usingwindow.location.href.