Solved

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

Posted on 2014-10-23
1
694 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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 …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

695 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