Click here to Skip to main content
Licence CPOL
First Posted 14 Jul 2008
Views 17,547
Downloads 275
Bookmarked 32 times

Rating Control using Custom Web Control

By | 6 Feb 2009 | Article
Custom web control using ASP.NET

Introduction

Well, I was working on a project in which I required a rating control. This rating control is developed using web control class in which we have 4 properties. By using these properties, we can use the rating control.

Background

I Googled and found paid rating controls. Then I decided to develop my own rating control.

Using the Code

Using this control is very easy. We have a class Voting in MyVote namespace. In the Voting class, we have 4 properties.

In this control, we have 4 properties in MyVotele or code.

View online demo.

  • VoteCount: It will return the number of vote users have clicked.
  • MouseOver_ImagePath: Set the image path of Mouse over image.
  • MouseOut_ImagePath: Set the image path of Mouse out image.
  • StarCount: Set the number of stars to be displayed in rating control.

In a *.aspx page, you have to register a control:

<%@ Register TagPrefix="MyBar" Namespace="MyVote" %> 

In a *.aspx page between form tags, write this:

<MyBar:voting runat="server" id="RatingCtrl" width="100px" StarCount="5"
 MouseOut_ImagePath="star.jpg" MouseOver_ImagePath="starover.jpg" 
	OnClick="RatingCtrl_Click" >
</MyBar:voting> 

Points of Interest

This control is very easy to use in different pages.

License

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

About the Author

Ravinder007

Team Leader

India India

Member

I am working in Microsoft technology since 2001. Love to write code in JavaScript, asp.net and Ajax. See my site at http://www.ravinderweb.com/

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralGood Work PinmemberSavanDavande21:04 15 Jul '10  
GeneralRe: Good Work PinmemberSavanDavande21:04 15 Jul '10  
GeneralThanks for sharing. PinmemberRajib Ahmed5:34 15 Jul '08  
GeneralRe: Thanks for sharing. PinmemberRavinder00718:46 15 Jul '08  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120528.1 | Last Updated 6 Feb 2009
Article Copyright 2008 by Ravinder007
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid