Solved

Input text box and drop down, need help in adding bootstrap look and field. MVC

Posted on 2014-10-23
1
660 Views
Last Modified: 2014-10-29
I have the following code and I'm trying to add the bootstrap look and field to the control... I need help...

Here is the code....


@using (Html.BeginForm())
    {
        
    <p>

     
            Find by Last Name or First Name: @Html.TextBox("SearchString", ViewBag.CurrentFilter as String)
        
            Location: @Html.DropDownList("LocationList", "All")
            <input type="submit" value="Search" />
        </p>

    }

Open in new window

0
Comment
Question by:yguyon28
1 Comment
 
LVL 23

Accepted Solution

by:
Ioannis Paraskevopoulos earned 500 total points
ID: 40401172
Hi,

You may use the overload that accepts htmlAttributes as a parm. You may check out this MSDN article.

In your case you could do it like (please note that the 'class' attribute must be preceded with a '@'):
@Html.TextBox("SearchString", ViewBag.CurrentFilter as String, new { @class = "" })

Open in new window


I have not added anything in the class, but you can populated with your bootstrap classes.

Giannis
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SlingPlayer alternatives 1 44
Need a starter for ETL protocol? 4 55
Code works but it's slow 28 70
Help with adding DLL file in Windows project 20 28
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question