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#?

Recommended Answers

All 2 Replies

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
DataBase
    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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.