hello i want to add two buttons in page like and dislike ..
user can like only one time also shows the values of likes pressing button(means like counter value show) and if user dislike then decrement in likes value how its posssible in asp.net using c#?

5 Years
Discussion Span
Last Post by bharat_4g

You would store the values in at least two database tables. One table holds information about the item that you are liking/disliking. You keep track of the counter here. Another table would record whether the user liked/disliked an item.

Then write code to enable/disable the like buttons depending on the user.

Hi Mani508, 
    The best way to do this is using ASP.NET AJAX or 
    Create a webservice in .net and call it using JQuery Ajax


    You need 3 tables to do this
    User table(with user id as primary key)
    Item table(with item id as primary key)
    User_Item_map(with item id, user id and value columns)(item id,user id as composite key)

Conditions to be checked

* Check if user has already liked or disliked the item from the database(In Page_load event)
* if liked or disliked disable the buttons
* else enable the buttons showing the counter of the likes and dislikes
* if any button is clicked call the service using ASP.NET AJAX or JQuery Ajax,update the database, increment the appropriate counter and disable the like buttons
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.