Solved

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

Posted on 2014-10-23
1
657 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now