Click here to Skip to main content
11,930,449 members (59,437 online)
Click here to Skip to main content
Add your own
alternative version


33 bookmarked

Rating Control using Custom Web Control

, 6 Feb 2009 CPOL
Rate this:
Please Sign up or sign in to vote.
Custom web control using ASP.NET


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.


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" >

Points of Interest

This control is very easy to use in different pages.


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


About the Author

Team Leader
India India
I am working in Microsoft technology since 2001. Love to write code in JavaScript, and Ajax. See my site at

You may also be interested in...

Comments and Discussions

GeneralGood Work Pin
SavanDavande15-Jul-10 22:04
memberSavanDavande15-Jul-10 22:04 
GeneralRe: Good Work Pin
SavanDavande15-Jul-10 22:04
memberSavanDavande15-Jul-10 22:04 
GeneralThanks for sharing. Pin
Rajib Ahmed15-Jul-08 6:34
memberRajib Ahmed15-Jul-08 6:34 
GeneralRe: Thanks for sharing. Pin
Ravinder00715-Jul-08 19:46
memberRavinder00715-Jul-08 19:46 

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

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

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