Using handler in asp.net

  var dvRandomChefs, dvChefsForRatting;
        $(document).ready(function () {
            dvRandomChefs = $("#dvRandomChefs");
            dvChefsForRatting = $("#dvChefsForRatting");
            Random4ChefList();


            dvRandomChefs.on({
                mouseenter: function () {
                    dvRandomChefs.cycle('pause');
                },
                mouseleave: function () {
                    dvRandomChefs.cycle('resume');
                }
            });

 function Random4ChefList() {
            var HandlerUrl = "/Handlers/ChefListRandom4.ashx?AreaID=<%= Profile.AreaID %>"
            var str = '';
            //var str = '  <fieldset><h3 class="hdngtxt org">Chefs in your Area</h3></fieldset>';
            $.ajax({
                type: "GET",
                contentType: "application/json; charset=utf-8",
                url: HandlerUrl,
                dataType: "json",
                global: false,
                error: function (data, textStatus) {
                },
                success: function (data) {
                    var ins = data;
                    $.each(ins, function (i, item) {
                        str += '<div>';
                        str += '<div class="boxchef bord wow fadeInUp">';
                        str += '    <div class="row">';
                        str += '       <img alt="" src="/' + item.PhotoLink + '" style="width: 100%; height: 100%; min-width:300px; border-bottom: 1px solid #dddddd" />';
                        str += '       <a class="__StarBtn" href="javascript:void(0);" onclick="showChefsRatings(' + item.Chef_ID + ')" ><span class="stars __Random">' + item.Stars + '</span></a>';
                        str += '       <div class="mod">';
                        str += '           <h3>' + item.Chef_Name + '<br>';
                        str += '               <span>(  ' + item.City_Name + ' )</span></h3>';
                        str += '           <h4>' + item.Category_Name + '</h4>';
                        str += '           <p style="height: 45px;">';
                        str += '               ' + item.CategoryNameList + '';
                        str += '           </p>';
                        str += '           <p>';
                        str += '               <a href="/EndUser/Public/ChefProfile.aspx?ChefID=' + base64encode(item.Chef_ID) + '&AreaID=' + base64encode(item.Area_ID) + '" class="btn __CHefListRM">Read More</a>';
                        str += '       </div>';
                        str += '   </div>';
                        str += '</div>';
                        str += '<div class="CL"></div>';
                        str += '</div>';
                    });
                    dvRandomChefs.html('').html(str);//+ "<div class='CL'></div>"
                    dvRandomChefs.cycle({
                        fx: 'shuffle',
                        delay: -1000
                    });
                    //shuffle
                    $(".__StarBtn").click(function (e) {
                        dvRandomChefs.off();
                        dvRandomChefs.cycle('pause');
                    })
                },
                complete: function () {
                    $('span.__Random').stars();
                    // tO = setTimeout('Random4ChefList();', 2000);
                    ChefListForRating();
                }
            });
        }

Comments

Popular posts from this blog

Form submit resulting in “InvalidDataException: Form value count limit 1024 exceeded.” In ASP.NET Core

Calculate Dynamic Current Calendar / Financial Year In C#

Repository Design Pattern in C#