评分控制在 asp.net 中不起作用

Rating control not working in asp.net

我正在使用 .net 框架 4.5。我需要制作我有用户 asp 评级控制的评级系统。现在,如果我尝试给出评级,行为不会改变。我也有 5 星评级,但如果我将鼠标悬停在任何星星上,它总是会显示工具提示 1。当我在 chrome 中看到开发人员工具时,它会显示此错误

请帮我解决这个问题。

<%@ 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(已编辑)

<%@ 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>

routes.Ignore("{resource}.axd/{*pathInfo}");

将此添加到您的 RegisterRoutes 函数中 .axd 文件在物理上不存在