本文转自:http://www.mytecbits.com/microsoft/dot-net/bootstrap-3-0-0-with-asp-net-web-forms

In my earlier article, I wrote about the step by step instructions on creating ASP.NET web forms application with Bootstrap UI Framework, using Twitter Bootstrap from NuGet as a package. However, In this article, I’m not using bootstrap NuGet Package. Instead I’m using the Bootstrap version 3.0.0 files, downloaded from GitHub and with an empty ASP.NET web forms application. This will be a simple and light weight sample web form, for you to build your application on.

If you are interested in using Bootstrap from NuGet package in web forms, then read the article Twitter Bootstrap with ASP.NET. Step by step instruction for using bootstrap with MVC 4 Razor engine without NuGet package is available in the article Bootstrap with ASP.NET MVC 4 here.

Tools and frameworks used:

  • Visual Studio Express 2012 for Web.
  • Dot Net Framework 4.5.
  • jQuery 2.0.3
  • Twitter Bootstrap 3.0.0 RC1 straight from GitHub.
  • Twitter Bootstrap Starter Template from http://getbootstrap.com/getting-started/#examples.

Sample Code:

The sample code is available in the continuation article� Bootstrap 3.0.0 with ASP.NET Web Forms – Step by Step – Sample Code.

Steps for using Bootstrap 3.0.0 with ASP.NET Web Forms:

  1. Launch Visual Studio (I’m using Visual Studio Express 2012 for Web).
  2. Create a new ASP.NET Empty Web Application.
  3. In the new project, create a folder Scripts to store the java script and jQuery files.
  4. Create another folder Content to store the css files and the image files. After creating new folders the solution looks like this.
  5. Bootstrap needs jQuery. So download the latest version of jQuery from http://jquery.com/download/. I’ve downloaded the compressed, production jQuery 2.0.3.
  6. Save the downloaded jQuery file in the Scripts folder in the project. Then include the file jquery-2.0.3.min.js to the project from the solution explorer.
  7. Download the latest version of Bootstrap from here.
  8. Extract the downloaded zip file (bs-v3.0.0-rc1-dist.zip). I’ve downloaded version 3.0.0 RC1. There will be 2 folders, one with js files and another with css files.
  9. Place the 2 bootstrap js files in the Scripts folder and include them to the project from the solution explorer.
  10. Copy the css folder from the bootstrap zip file and place it inside the Content folder of the project. Then include the css folder and it’s contents to the project.
  11. After including the files, the solution explorer looks like this.
  12. Download the bootstrap starter template from examples.getbootstrap.com.
  13. Create a master page for the project and re-name it if needed. For creating a master page, right-click the project in the solution explorer, select Add, select New Item… and create new Master Page.
  14. Edit the new master page and link the bootstrap css inside the title block.
  15. Remove the <form> tag set from the master page.
  16. Add the navigation bar (navbar) section from the downloaded bootstrap sample template below the start of the <Body> tag.�
  17. In the <div> tag surrounding the <asp:ContentPlaceHolder> add the class� class=”container”.
  18. Just above the end of the body tag, add the jQuery file and the bootstrap.min.js file using the script tag with src attribute. Make sure to add jQuery file above the bootstrap file.
  19. The master page is now ready and looks like this:
  20. Create a default page. For creating Default.aspx page, right clicking the project, select Add, select New Item… and select Web Form Using Master Page. In the Master Page Selection screen select the new master page you have created earlier.
  21. Edit the� Default.aspx page and write something inside the� ContentPlaceHolder1 content section.
  22. Now your solution is ready to be build.
  23. Build the ASP.NET Web Forms solution, either by hitting the F5 key or by clicking the green build arrow at the Visual Studio tool bar. On successful build, the web page will be launched in the browser similar to the one shown below.
  24. This bootstrap User Interface layout is responsive in nature. This is, when you open this UI in small screens like smart phones or tablets, the menu and content rearrange itself to fit the screen. You can check this by re-sizing the browser screen in PC.

The location of the source code for the sample solution created with the above steps is available in the continuation article� Bootstrap 3.0.0 with ASP.NET Web Forms – Step by Step – Sample Code. Get The Sample Code –>

Other Dot Net Bootstrap Articles:

[转]Bootstrap 3.0.0 with ASP.NET Web Forms – Step by Step – Without NuGet Package的更多相关文章

  1. Professional C# 6 and .NET Core 1.0 - Chapter 42 ASP.NET Web API

    本文内容为转载,重新排版以供学习研究.如有侵权,请联系作者删除. 转载请注明本文出处: -------------------------------------------------------- ...

  2. Using Friendly URLs in ASP.NET Web Forms

    Introduction Websites often need to generate SEO friendly URLs. In ASP.NET Web Forms applications, a ...

  3. 【翻译】使用Knockout, Web API 和 ASP.Net Web Forms 进行简单数据绑定

    原文地址:http://www.dotnetjalps.com/2013/05/Simple-data-binding-with-Knockout-Web-API-and-ASP-Net-Web-Fo ...

  4. ASP.NET Web Forms的改进

    虽然ASP.NET Web Forms不是vNext计划的一部分,但它并没有被忽视.作为Visual Studio 2013 Update 2的一部分,它重新开始支持新工具.EF集成和Roslyn. ...

  5. Knockout, Web API 和 ASP.Net Web Forms 进行简单数据绑定

    使用Knockout, Web API 和 ASP.Net Web Forms 进行简单数据绑定   原文地址:http://www.dotnetjalps.com/2013/05/Simple-da ...

  6. ASP.NET Web Forms - 网站导航(Sitemap 文件)

    [参考]ASP.NET Web Forms - 导航 ASP.NET 带有内建的导航控件. 网站导航 维护大型网站的菜单是困难而且费时的. 在 ASP.NET 中,菜单可存储在文件中,这样易于维护.文 ...

  7. 在ASP.NET Web Forms中用System.Web.Optimization取代SquishIt

    将一个ASP.NET Web Forms项目从.NET Framework 4.0升级至.NET Framework 4.5之后,发现SquishIt竟然引发了HTTP Error 500.0 - I ...

  8. ASP.NET Web Forms 的 DI 應用範例

    跟 ASP.NET MVC 与 Web API 比起来,在 Web Forms 应用程式中使用 Dependency Injection 要来的麻烦些.这里用一个范例来说明如何注入相依物件至 Web ...

  9. Asp.Net Web Forms/MVC/Console App中使用Autofac

    本来简单介绍了Autofac在Asp.Net Web Forms中的应用,后来又添加了mvc.控制台应用程序中使用Autofac,详情请看源码. ASP.NET Web Forms使用Autofac, ...

随机推荐

  1. 【zepto学习笔记01】核心方法$()

    前言 我们移动端基本使用zepto了,而我也从一个小白变成稍微靠谱一点的前端了,最近居然经常要改到zepto源码但是,我对zepto不太熟悉,其实前端水准还是不够,所以便私下偷偷学习下吧,别被发现了 ...

  2. 原生JS:Math对象详解

    Math对象 本文参考MDN做的详细整理,方便大家参考MDN Math 也是一个内置对象, 为数学常量和数学函数提供了属性和方法,而不是一个函数对象. 与其它全局对象不同的是, Math 不是一个构造 ...

  3. Egret白鹭H5小游戏开发入门(一)

    前言: 好久没更新博客了,以前很多都不会,所以常常写博客总结,倒是现在有点点经验了就懒了.在过去的几个月里,在canvas游戏框架方面,撸过了CreateJS,玩得了Egret,又学过PIXI.js. ...

  4. AE_复制当前图层

    private void 复制ToolStripMenuItem_Click(object sender, EventArgs e) { int layercount = axMapControl2. ...

  5. 虚拟机克隆以后出现“需要整合虚拟机磁盘”的解决方法

    问题描述 在虚拟机克隆完毕以后,原始虚拟机提示"需要整合虚拟机磁盘" 在"任务与事件"栏中看到以下信息 解决方法 从上面可以看到是因为整合失败导致的,那么我们只 ...

  6. Android Action Bar简介

    Android Action Bar简介 Design: Action Bar Action Bar是在屏幕顶端的一部分内容,通常在整个app进行中都保持存在. 它提供了几个关键的功能: 1.使得重要 ...

  7. 对tableView三种计算动态行高方法的分析

    tableView是一个神奇的东西,可以这么说,就算是一个初学者如果能把tableView玩的很6,那编一般的iOS的需求都问题不大了.tableView是日常开发中用烂了的控件,但是关于tableV ...

  8. 开发Android系统内置应用小记

    Android系统内置应用可以使用更多的API.更高的权限,与开发普通应用最大的差别在于编译,内置应用编译需要用到Android.mk文件.下面是我在开发过程中的一些小记. 1.在AndroidMai ...

  9. 学习Coding-iOS开源项目日志(一)

    前言:作为初级程序员,想要提高自己的水平,其中一个有效的学习方法就是学习别人好的项目.本篇开始会陆续更新本人对github上开源的一个很不错的项目的一点点学习积累.也就是,探究着别人写的源码,我学到了 ...

  10. IIS和tomcat共用80端口

    IIS和tomcat共用80端口 很多机器都需要同时使用tomcat和iis两个服务器以部署不同的网站,而解决共用80端口的问题也经常遇到,今天实际操作了一回,以下是具体步骤: 实现tomcat和ii ...