Solved

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

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to prevent website from publishing with errors 9 53
C# bracket error 3 35
Release Dynamically Allocated Memory in C# 3 37
Convert Ctime to date time in textfile? 7 28
Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

792 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