SUN
SUN

Reputation: 973

Rating control not working in asp.net

I am usinf .net framework 4.5. I need to make rating system for which I have user asp rating control. Now if I try to give rating behavior doesn't changed. Also I have 5 star rating but If I hover mouse on any star it will always shows tool tip 1. When I saw a developer tools in chrome this errors it shows enter image description here

Please help me to fix this issue.

<%@ 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(Default)

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

Upvotes: 1

Views: 462

Answers (1)

GaAd
GaAd

Reputation: 145

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

Add this in your RegisterRoutes function .axd files don't exist physically

Upvotes: 1

Related Questions