Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do ASP.NET Identity framework (forms) with bootstrap

I'm doing an ASP.NET Web Application with Identity with this tutorial:

http://www.asp.net/identity/overview/getting-started/adding-aspnet-identity-to-an-empty-or-existing-web-forms-project

But I would like to the form with bootstrap like that:

<div class="input-group">
  <input type="text" class="form-control" placeholder="Username">
</div>

But the form with .aspx is so:

    <asp:Literal runat="server" ID="StatusMessage" />
</p>                
<div style="margin-bottom:10px">
    <asp:Label runat="server" AssociatedControlID="UserName">User name</asp:Label>
    <div>
        <asp:TextBox runat="server" ID="UserName" />                
    </div>
</div>

How it should be? Thanks.

like image 817
user1911 Avatar asked Apr 02 '14 10:04

user1911


People also ask

How bootstrap is implemented in ASP NET?

Bootstrap provides all the pieces you need for layout, buttons, forms, menus, widgets, picture carousels, labels, badges, typography, and all sorts of features. Since Bootstrap is all HTML, CSS and JavaScript, all open standards, you can use it with any framework including ASP.NET MVC.

How does ASP NET identity work?

ASP.NET Core Identity is a membership system which allows you to add login functionality to your application. Users can create an account and login with a user name and password or they can use an external login providers such as Facebook, Google, Microsoft Account, Twitter and more.

Is ASP NET core identity a framework?

ASP.NET Core Identity framework is used to implement forms authentication. There are many options to choose from for identifying your users including Windows Authentication and all of the third-party identity providers like Google, Microsoft, Facebook, and GitHub etc.


1 Answers

The idea is to add the css class's of bootstrap to the asp.net controls, and what other attributes you may like as:

<div class="input-group">
    <asp:Label runat="server" AssociatedControlID="UserName">User name</asp:Label>
    <asp:TextBox runat="server" ID="UserName" CssClass="form-control" placeholder="Username" />                
</div>
like image 200
Aristos Avatar answered Oct 02 '22 23:10

Aristos