Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7651925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:37:44+00:00 2026-05-31T11:37:44+00:00

I have been working in ASP.NET Web Applications (not MVC) for a while at

  • 0

I have been working in ASP.NET Web Applications (not MVC) for a while at work. I really would like to use the twitter bootstrap framwork. I think it looks great and has a lot of the work already taken care of for you. I cannot seem to get it to work with ASP server controls. I know that the css is probably trying to change the asp:Button tag to an HTML tag. I just have no idea how to get these to work together. I get the following error.

Warning 2 //file location : ASP.NET runtime error: The base class includes the field ‘btnTest’, but its type (System.Web.UI.HtmlControls.HtmlButton) is not compatible with the type of control (System.Web.UI.WebControls.Button). //File location 21 1 FalconFutbolClub

When rendering the site to debug, I get the following error:

Control ‘mainContentHolder_btnTest’ of type ‘Button’ must be placed inside a form tag with runat=server.

I think it would be really annoying to try to manage postbacks with javascript. I really would just like to use regular ASP server controls, hence the whole reason of using ASP.NET Web Applications. Please help.

EDIT: Code. Here is the master page and my default.

Master Asp:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs"           Inherits="FalconFutbolClub.SiteMaster" %>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Falcon Futbol</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="What's in your toybox?">
    <meta name="author" content="Pure Parties">
    <link rel="stylesheet" type="text/css" href="assets/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="assets/css/style.css">
    <link rel="stylesheet" type="text/css" href="assets/css/bootstrap-responsive.css">

    <link rel="shortcut icon" href="images/favicon.ico">
    <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
    <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">

    <style>
      body {
        padding-top: 85px; /* 60px to make the container go all the way to the bottom of the topbar */
      }
    </style>
    <asp:ContentPlaceHolder ID="headerContentHolder" runat="server" />
  </head>

  <body>

    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="#">Falcon Futbol</a>
          <div class="nav-collapse">
            <ul class="nav">
              <li class="active"><a href="#">Home</a></li>
              <li><a href="#about">About</a></li>
              <li><a href="#contact">Contact</a></li>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container">
        <div class="row">
            <div span="12">
            <asp:ContentPlaceHolder ID="mainContentHolder" runat="server" />
        </div>
    </div>
</div>



<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap-transition.js"></script>
<script src="assets/js/bootstrap-alert.js"></script>
<script src="assets/js/bootstrap-modal.js"></script>
<script src="assets/js/bootstrap-dropdown.js"></script>
<script src="assets/js/bootstrap-scrollspy.js"></script>
<script src="assets/js/bootstrap-tab.js"></script>
<script src="assets/js/bootstrap-tooltip.js"></script>
<script src="assets/js/bootstrap-popover.js"></script>
<script src="assets/js/bootstrap-button.js"></script>
<script src="assets/js/bootstrap-collapse.js"></script>
<script src="assets/js/bootstrap-carousel.js"></script>
<script src="assets/js/bootstrap-typeahead.js"></script>

<script type="text/javascript">
    $('.carousel').carousel({
        interval: 2000
    })
</script>
  </body>
</html>

Master C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace FalconFutbolClub
{
    public partial class SiteMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}    

Default aspx:

<asp:Content ID="content1" ContentPlaceHolderID="headerContentHolder" runat="server">
    <script type="text/javascript">

    </script>
</asp:Content>

<asp:Content ID="content2" ContentPlaceHolderID="mainContentHolder" runat="server">
    <div class="container">
        <header class="jumbotron subhead" id="overview">
            <h1>Falcon Futbol</h1>
            <p>Event registration forms can be filled out here.</p>
            <asp:Label ID="clickedTest" runat="server" />
        </header>
        <div class="span12">
            <blockquote>
                <p>Event registration form 1.</p>
                <small>March 17, 2012</small>
            </blockquote>
            <div class="span4">
                <asp:Button id="btnTest" runat="server" onclick="btnForm1_Click" Text="test" />
            </div>
        </div>
    </div>
</asp:Content>

Default C#:

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.IO;

namespace FalconFutbolClub
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btnForm1_Click(object sender, EventArgs e)
        {
            clickedTest.Text = "Clicked!";
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:37:45+00:00Added an answer on May 31, 2026 at 11:37 am

    Looks like you answered this yourself! Just to follow up on it – normally just after the body tag of a masterpage you would have a form tag:

     <body>
     <form id="form1" runat="server" >
        <div class="navbar navbar-fixed-top">
          <div class="navbar-inner">
           <!-- omitted code from above -->
         </div>
      </div>
    
    </form>
    </body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a web app using C# and asp.net I have been
I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#)
I have been working my way through Scott Guthrie's excellent post on ASP.NET MVC
I have been working with ASP.NET MVC for a couple of months now and
I have been working through Microsoft's ASP.NET MVC tutorials, ending up at this page
I'm working on an ASP.NET MVC 3 web application, where i use TempData to
For past projects(the last few have been web using asp.net mvc) we created a
For the last 4 years I have been working as an ASP.NET developer in
On a recent project I have been working on in C#/ASP.NET I have some
I'm working on a asp.net mvc2 app. I have been using jquery to do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.