将脚本和样式添加到Web窗体Asp.net

时间:2015-09-23 18:45:29

标签: c# asp.net webforms

我的ASP.net webform应用程序中有Login Page

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="WebApplication3.View.Login" %>



<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>RIL GROUP OF COMPANIES</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes" />



<script src="<%=BundleTable.Bundles.ResolveBundleUrl("~/bundles/jqueryui")%>" type="text/javascript"></script>
<script src="<%=BundleTable.Bundles.ResolveBundleUrl("~/bundles/jquery")%>" type="text/javascript"></script>
<script src="<%=BundleTable.Bundles.ResolveBundleUrl("~/bundles/lanceng")%>" type="text/javascript"></script>
 <script src="<%=BundleTable.Bundles.ResolveBundleUrl("~/bundles/jqueryval")%>" type="text/javascript"></script>
  <link href="<%=BundleTable.Bundles.ResolveBundleUrl("~/Content/lancengcss")%>" rel="stylesheet" type="text/css" media="screen"></link>
 <link href="<%=BundleTable.Bundles.ResolveBundleUrl("~/Content/css")%>" rel="stylesheet" type="text/css" media="screen"></link>



   <%-- <script>
        <%: Scripts.Render("~/bundles/jqueryval") %> 
        <%: Scripts.Render("~/bundles/jquery") %>
        <%: Scripts.Render("~/bundles/lanceng")%>
        <%: Scripts.Render("~/bundles/jqueryui")%>
    </script>
<style>
<%: Styles.Render("~/Content/lancengcss") %>
<%: Styles.Render("~/Content/css") %>
</style>--%>
<link rel="shortcut icon" href="assets/img/favicon.ico"/>
</head>

    <!-- BODY -->
<body class="tooltips full-content">

    <!-- BEGIN PAGE -->
<div class="container">

<!-- Begin Login Page -->
    <div class="full-content-center animated fadeInDownBig">
        <a href="#fakelink"><img src="assets/img/logo.png" class="logo-login img-circle" alt="Logo"></a>
        <div class="login-wrap">
            <div class="box-info">
            <h2 class="text-center"><strong>Login</strong> form</h2>

<asp:Label ID="loginError" runat="server" Text="Username/Password is incorrect" Visible="false"></asp:Label>
<br />
<form id="form1" runat="server" role="form">

      <div class="login-wrap">
           <div class="box-info">
                 <h2 class="text-center"><strong>Login</strong> form</h2>

                  <div class="form-group login-input">
                  <i class="fa fa-sign-in overlay"></i>

                 <asp:TextBox ID="tb_username" runat="server"></asp:TextBox>
                 <asp:Label ID="usernameError" runat="server" Text="*Username is required" ForeColor="Red" Visible="false"></asp:Label>
                   </div>



        <asp:Label ID="lbl_password" runat="server" Text="Password"></asp:Label>
        <asp:TextBox ID="tb_password" runat="server" TextMode="Password" class="form-control text-input" placeholder="Username"></asp:TextBox>
        <asp:Label ID="passwordError" runat="server" Text="*Password is required" ForeColor="Red" Visible="false"></asp:Label>


        <asp:Button ID="btn_login" runat="server" Text="Login" OnClick="btn_login_Click" Width="55px" />
        <asp:Button ID="btn_cancel" runat="server" Text="Cancel" OnClick="btn_cancel_Click" Width="55px" />

        <asp:HyperLink ID="hyperlink_Register" runat="server" Text="Register Here..." NavigateUrl="~/View/RegisterUser.aspx"></asp:HyperLink>
    </div>
</form>

这些是我的脚本和样式:(其中一些)

<link href="assets/css/bootstrap.min.css" rel="stylesheet">

<!-- LANCENG CSS -->
<link href="assets/css/style.css" rel="stylesheet">
<link href="assets/css/style-responsive.css" rel="stylesheet">

<!-- VENDOR -->
<link href="assets/css/animate.css" rel="stylesheet">

<script src="assets/third/nifty-modal/js/classie.js"></script>
<script src="assets/third/nifty-modal/js/modalEffects.js"></script>

我的bundle.config似乎不起作用,我想我只想声明所有的脚本和样式。

1 个答案:

答案 0 :(得分:0)

这是你的问题的答案,检查你的代码,你做了同样的事情。 然后你的bundle.config文件可以工作。

Can i use Bundling [Bundle.Config] in .net 4 Asp.Net web Application