评级控制无法在asp.net中运行

时间:2017-06-27 04:25:43

标签: c# asp.net ajaxcontroltoolkit

我是usinf .net framework 4.5。我需要制作我有用户asp评级控制的评级系统。现在,如果我尝试给评级行为不改变。此外,我有5星评级,但如果我将鼠标悬停在任何一颗星上,它将始终显示工具提示1.当我在Chrome中看到一个开发人员工具时,这个错误显示 enter image description here

请帮我解决这个问题。

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ratings.aspx.vb" Inherits="ratings" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
     <link rel="stylesheet" type="text/css" href="/fonts/fontawesome/fontawesome.css" />
    <style type="text/css">
        .star {
            color: #f00;
            font-size:2em
        }

        .empty {
            color: #ccc;
            font-size:2em
        }

        .WaitingStar {
            color: #ed2025;
            font-size:2em
        }

        .FilledStar{
            color: #ffcc00;
            font-size:2em
        }
    </style>

</head>
<body>
    <form id="form1" runat="server">
        <asp:ToolKitScriptManager ID="sc1" runat="server"></asp:ToolKitScriptManager>
    <div>
        <asp:Rating ID="r1" runat="server" EmptyStarCssClass="fa fa-star empty" StarCssClass="fa fa-star empty" WaitingStarCssClass="fa fa-star WaitingStar" FilledStarCssClass="fa fa-star FilledStar" MaxRating="5" CurrentRating="1"></asp:Rating>
    </div>
    </form>
</body>
</html>

的Global.asax(默认)

<%@ Application Language="VB" %>
<%@ Import Namespace="System.Web.Optimization" %>
<%@ Import Namespace="System.Web.Routing" %>

    <script runat="server">

        Sub Application_Start(sender As Object, e As EventArgs)
            RouteConfig.RegisterRoutes(RouteTable.Routes)
            BundleConfig.RegisterBundles(BundleTable.Bundles)
        End Sub
    </script>

的Global.asax(Editted)

<%@ Application Language="VB" %>
<%@ Import Namespace="System.Web.Optimization" %>
<%@ Import Namespace="System.Web.Routing" %>

<script runat="server">
    Sub Application_Start(sender As Object, e As EventArgs)
        'RouteConfig.RegisterRoutes(RouteTable.Routes)
        BundleConfig.RegisterBundles(BundleTable.Bundles)
        RegisterRoutes(RouteTable.Routes)
    End Sub

    Private Shared Sub RegisterRoutes(routes As RouteCollection)
        routes.MapPageRoute("index", "index", "~/index.aspx")
        routes.MapPageRoute("cart", "cart", "~/cart.aspx")
        routes.MapPageRoute("search", "search/{searhWords}", "~/search.aspx")
        routes.MapPageRoute("allListing", "{type}", "~/all-listing.aspx")
        routes.MapPageRoute("allListing2", "all/{type}", "~/all-listing2.aspx")
        routes.MapPageRoute("priceRangeWise", "price-range/{price}", "~/price-range-wise.aspx")
        routes.MapPageRoute("skillPage", "skill/{categoryName}/{slug}/{productPageID}", "~/experience-page.aspx")
    End Sub
</script>

1 个答案:

答案 0 :(得分:1)

routes.Ignore( “{}资源个.axd / {*} PATHINFO”);

在RegisterRoutes功能中添加此功能 .axd文件不存在物理