如何在asp.net mvc中创建一个简单的加或减等级 [英] How to create a simple plus or minus rating in asp.net mvc

查看:92
本文介绍了如何在asp.net mvc中创建一个简单的加或减等级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i有一个框,我显示评论,我想让其他用户按加号或减号按钮评价此评论,每个用户只能投票一次。

i已经通过保存用户的IP地址来写这个,以便每个评论都有关联的ips投票给那个评论。

下次我可以检查IP地址并让用户投票或不投票。另一件事是我的网站没有认证(任何人都可以投票)

但是我觉得这很糟糕,任何人都有更好的想法?



这里是我要做的小屏幕截图:



http://axgig.com/images/24738083558435364695.jpg



谢谢大家阅读或回答

Hi,
i have a box where i display a comment and i want to let other users to rate this comment by pressing Plus or Minus button and every user must vote only once.
i have wrote that by saving user ip address so that every comment has associated ips that voted to that comment.
next time i can check the ip address and let user to vote or not. another thing is that there no authentication in my site (any one can vote)
but i feel bad about this, any one has better idea??

here is a small screen shot of what im gonna do:

http://axgig.com/images/24738083558435364695.jpg

Thank you all for reading or answering

推荐答案

您需要做的就是创建自定义控件,其中提供了描述功能:

使用局部视图创建ASP .NET MVC 3用户控件 [ ^ ]

ASP.NET MVC中的自定义控件 [ ^ ]



两篇有趣的文章:

创建上下投票用户界面(ASP.NET) [ ^ ]

使用ASP.NET MVC和jQuery构建星级评分系统 [ ^ ]



其他来源:

ASP.NET MVC 2投票控制 [ ^ ]



我希望它足以开始;)
All you need to do is to create "custom control" which provides described functionality:
Creating an ASP .NET MVC 3 User Control with a Partial View[^]
Custom controls in ASP.NET MVC[^]

Two interesting articles about:
Creating an Up and Down Voting User Interface (ASP.NET)[^]
Building a Star Rating System with ASP.NET MVC and jQuery[^]

Other sources:
ASP.NET MVC 2 Voting Control[^]

I hope it would be enough for start ;)


这篇关于如何在asp.net mvc中创建一个简单的加或减等级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆