Introduction
This article will help you to create a responsive website using ASP.NET with Bootstrap. Learn more about Bootstrap from here.
Step 1
Download the responsive CSS and JavaScript files from Bootstrap.com.
Step 2
Open your Visual Studio then add your downloaded file into your project then add index.aspx page and call your necessary files with in the head tag from that downloaded folder.
- <head runat="server">
- <title></title>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
- <script src="js/bootstrap.min.js"></script>
- <link href="css/bootstrap.min.css" rel="stylesheet" />
- </head>
Step 3
Consider <div class="row"></div> as a new line. Whatever you want to design in a row you should design with in a <div class="row">My design</div>.
Then <div class="col-lg-12"></div>
- <div class="row">
- <div class="col-lg-12">
- My design
- </div>
- </div>
Full Example
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="Responsive_Website.index" %>
- <!DOCTYPE html>
- <html
- xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
- <script src="js/bootstrap.min.js"></script>
- <link href="css/bootstrap.min.css" rel="stylesheet" />
- </head>
- <body>
- <form id="form1" runat="server">
- <div class="container">
- <div class="row">
- <div class="col-lg-3"></div>
- <div class="col-lg-6">
- <form class="form-signin">
- <h2 class="form-signin-heading">Please sign in</h2>
- <label for="inputEmail" class="sr-only">Email address</label>
- <input type="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
- <label for="inputPassword" class="sr-only">Password</label>
- <input type="password" id="inputPassword" class="form-control" placeholder="Password" required>
- <div class="checkbox">
- <label>
- <input type="checkbox" value="remember-me">
- Remember me
- </label>
- </div>
- <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
- </form>
- </div>
- <div class="col-lg-3"></div>
- </div>
- </div>
- </form>
- </body>
- </html>
Output (on large screens)
Output (on small screens)


Tomas BujnaPosted May 10, 2018, 12:03 AM EDT
Is nested forms good practice?
Chinna DuraiPosted Mar 24, 2017, 12:25 AM EDT
I said this is really nice code for me !!!
Shahbaz AliPosted Nov 24, 2016, 7:36 PM EST
Very handy and instruct full article. nice one
Bruno PétersonPosted Jun 19, 2015, 6:03 AM EDT
Simple, this is a good starting.
NitinPosted May 11, 2015, 8:17 AM EDT
nice
Sibeesh VenuTOP 100Posted May 10, 2015, 11:00 PM EDT
Good One :)
Abhishek JaiswalPosted May 10, 2015, 10:31 PM EDT
Bootstrap is always there, when we talk about responsiveness(recent times)! Well nice article! :)
Manoj BhoirPosted May 10, 2015, 10:07 PM EDT
Good One
Karthik Muthu KaruppanPosted May 4, 2015, 10:03 AM EDT
nice
Saroj Kumar SahuPosted May 4, 2015, 3:59 AM EDT
Great job :)
Hëàrt BëàtPosted May 3, 2015, 2:39 AM EDT
thanks for sharing ! keep up the good work :)
Santhakumar MunuswamyPosted May 2, 2015, 9:43 PM EDT
Good Work