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

  • Home
  • SEARCH
  • 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 8999969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:15:02+00:00 2026-06-16T00:15:02+00:00

I have a rather simple setup here using the new ASP.Net 4.5 in a

  • 0

I have a rather simple setup here using the new ASP.Net 4.5 in a Web Forms solution. I have been using Twitter Bootstrap for nearly a year and really enjoy the time it saves me and the consistency it brings to the table. Some of their javascript methods are quite useful as well. However, I am having a problem incorporating some of the “new way” things seem to need to be done in 4.5. Here is my Master Page:

<body>
    <form id="frmMain" runat="server">
        <asp:ScriptManager ID="smManager" runat="server">
            <Scripts>
                <asp:ScriptReference Name="jquery" />
                <asp:ScriptReference Name="bootstrap" />
            </Scripts>
        </asp:ScriptManager>
...

And here is the content of a test page:

<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="server">
    <asp:TextBox ID="txtTest" runat="server"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Problem" ControlToValidate="txtTest" CssClass="error" SetFocusOnError="True" ToolTip="Problem">*</asp:RequiredFieldValidator>
    <asp:Button ID="btnTest" runat="server" Text="Check" CausesValidation="true" OnClick="btnTest_Click" /><br />
    <asp:TextBox ID="txtAnother" runat="server"></asp:TextBox>
    <asp:Button ID="btnOk" runat="server" CausesValidation="false" Text="No Check" />
</asp:Content>

Here is my Global.asax.cs file to show the ScriptReferences noted above:

protected void Application_Start(object sender, EventArgs e) {
    GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;

    ScriptManager.ScriptResourceMapping.AddDefinition(
        "jquery",
        new ScriptResourceDefinition {
            Path = "~/Scripts/jquery-1.8.2.min.js",
            DebugPath = "~/Scripts/jquery-1.8.2.js",
            CdnPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js",
            CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.8.2.js",
            LoadSuccessExpression = "window.jQuery"
        }
    ); // Load jQuery

    ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.WebForms;

    ScriptManager.ScriptResourceMapping.AddDefinition(
        "bootstrap",
        new ScriptResourceDefinition {
            Path = "~/Scripts/bootstrap.min.js",
            DebugPath = "~/Scripts/bootstrap.js"
        }
    ); // Load Bootstrap

The client side checking on the first text box is not firing. If I click the ‘Check’ button it does a round-trip and the code-behind’s Page.IsValid == false. That is good, but I do not want to post back when the page is not valid.

I created another test page that did not use my Master page but had the same code in it as follows:

<form id="form1" runat="server">
    <div>
        <asp:TextBox ID="txtTest" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Problem" ControlToValidate="txtTest" CssClass="error" SetFocusOnError="True" ToolTip="Problem">*</asp:RequiredFieldValidator>
        <asp:Button ID="btnTest" runat="server" Text="Check" OnClick="btnTest_Click" /><br />
        <asp:TextBox ID="txtAnother" runat="server"></asp:TextBox>
        <asp:Button ID="btnOk" runat="server" CausesValidation="false" OnClick="btnOk_Click" Text="No Check" />
    </div>
</form>

This page throws the client side and thus stops the post back as I want it to.

It seems to me that the bootstrap.js may be haulting or interrupting the standard js validation. Any suggestions where I can still use bootstrap? I need the bootstrap.js file since it handles the dropdown menus. I could at least use jQuery’s UI for the modals but that doesn’t help the dropdowns.

I want to use the new technology but we always have these learning curves.

  • 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-06-16T00:15:03+00:00Added an answer on June 16, 2026 at 12:15 am

    You can select plugins that you really need here: http://twitter.github.com/bootstrap/customize.html#plugins
    I think bootstrap.js contains all-in-one combined solution. So you might try using only what you need and see if it helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm rather new to WPF, so maybe this is a simple question. I have
Im pretty new to CI so bear with me here. I have just setup
I'm building a simple ASP.NET web application in VS 2008 with a SQL 2005
I'm new to PHP and have run into a rather simple yet annoying issue.
Have a rather simple question. Does anyone knows if i can use jparallax both
I have a rather simple ListView row: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content
I have a rather simple question that I could normally debug myself, but I
I have following rather simple query select count(*) from tbl t1, tbl t2 For
my question is rather simple, if you have an pure virtual class (interface) but
I will try to keep this as simple as possible. I have a rather

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.