Solved

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

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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 …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

16 Experts available now in Live!

Get 1:1 Help Now