Click here to Skip to main content
16,014,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to implement rating functionality to my images which are in mvc4 page in designing time.I successfully integrate all the content which is given by our developer in .cshtml file except rating functionality. I added all jquery and css files in to my solution even though i am not getting the rating functionality.
Below i am sending my "_productfilter.cshtml page(master page)" code.
Please mention some modifications in my code for successful rating functionality


Razor
@{
    Layout = null;
}

<!DOCTYPE html>
<html lang="en" ng-app="bootstrapDemoApp" id="top">
    <head>
        <meta charset="utf-8" />
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
       @Scripts.Render("~/bundles/jquery")
        @Scripts.Render("~/bundles/knockout")
        @Styles.Render("~/Content/css")
        @Scripts.Render("~/bundles/modernizr")
        @RenderSection("scripts", required: false)      
        @Scripts.Render("~/bundles/jquery")

    <meta charset="utf-8">    
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="~/Content/bootstrap.css" rel="stylesheet"/>
    <link href="~/Content/bootstrap-responsive.css" rel="stylesheet"/>
    <link href="~/Content/globalstyle.css" rel="stylesheet"/>
    @*<link href="~/Content/bootstrap-responsive.min.css" rel="stylesheet" />*@
   
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="~/Scripts/html5shiv.js"></script>
    <![endif]-->


  </head>

  <body>

     @*<section class="content-wrapper main-content clear-fix">*@

                @RenderBody()
            @*</section>*@
</div>

    

</div>
      <!-- FOOTER -->
    
<a class="scrolltotop" href="#"><span>up</span></a>
     
    
    </div><!-- /.container -->



    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="~/Scripts/jquery.js"></script>
    <script src="~/Scripts/bootstrap-transition.js"></script>
    <script src="~/Scripts/bootstrap-alert.js"></script>
    <script src="~/Scripts/bootstrap-modal.js"></script>
    <script src="~/Scripts/bootstrap-dropdown.js"></script>
    <script src="~/Scripts/bootstrap-tab.js"></script>
    <script src="~/Scripts/bootstrap-tooltip.js"></script>
    <script src="~/Scripts/bootstrap-popover.js"></script>
    <script src="~/Scripts/bootstrap-button.js"></script>
    <script src="~/Scripts/bootstrap-collapse.js"></script>
    <script src="~/Scripts/bootstrap-carousel.js"></script>
    <script src="~/Scripts/bootstrap-typeahead.js"></script>
    
    <script>
        !function ($) {
            $(function () {
                // carousel demo
                $('#myCarousel').carousel()
            })
        }(window.jQuery)
    </script>
    <script src="~/Scripts/holder/holder.js"></script>

<script type="text/javascript">
    $(function () {

        $('.area').slimscroll({
            width: '135px'
        }).parent().css({
            'float': 'left',
        });

        $('.area').slimScroll({
            start: $('.helloDIV')
        });

    });

</script>
<script type="text/javascript" src="~/Scripts/1.9.0-jquery.min.js"></script>
<script type="text/javascript" src="~/Scripts/1.10.1-jquery-ui.min.js"></script>
<script type="text/javascript" src="~/Scripts/prettify/prettify.js"></script>
<script type="text/javascript" src="~/Scripts/prettify/jquery.slimscroll.min.js"></script>
<link href="~/Scripts/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="~/Scripts/script.js"></script>
<script type="text/javascript" src="~/Scripts/touchTouch.jquery.js"></script>

<script>var RatingDemoCtrl = function ($scope) {
    $scope.rate = 4;
    $scope.isReadonly = false;
};
</script>

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js"></script>
<script src="~/Scripts/rating/1.0.5-angular.min.js"></script>
<script src="~/Scripts/ui-bootstrap-tpls-0.4.0.js"></script>
  <script src="~/Scripts/rating/angular.min.js"></script>  
<script src="~/Scripts/ui-select2.js"></script>
<script src="~/Scripts/plunker.js"></script>
<script src="~/Scripts/app.js"></script>

  </body>
</html>




---->my master page i.e _productfilter.cshtml
Posted
Comments
ZurdoDev 25-Jul-13 9:08am    
What is happening and what do you want to happen? Narrow it down to the specific code that is the issue.
sarath from cst 25-Jul-13 9:11am    
<script>var RatingDemoCtrl = function ($scope) {
$scope.rate = 4;
$scope.isReadonly = false;
};
</script>

This is my actual code.i addead this in to my code but it not working
ZurdoDev 25-Jul-13 9:33am    
What does not working mean? What are you expecting it to do?
sarath from cst 25-Jul-13 10:06am    
I want to implement star rating functionality for product like in on line shopping websites.my designer is design one page like that.I am exactly taken that code and copied in to my .cshtml page and iam also copy the all jqueries and .css files but iam not getting my page like my designer page.
Prasad Khandekar 25-Jul-13 10:32am    
Hello Sarath,

You might find this CP article useful. (http://www.codeproject.com/Tips/503495/Simple-rating-control-using-jQuery) You can also have a look at (http://www.jquery4u.com/plugins/10-jquery-rating-plugins/).

Regards,

1 solution

There is one simple and interesting plugin avalible for rating
http://wbotelhos.com/raty[^]

Try this out.

Hope this Helps You

Happy Coding :-)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900