ASP.NET MVC场景,类似于StackOverflow上的“发布您的答案”(ASP.NET MVC scenario, similar to 'Post your answer

编程入门 行业动态 更新时间:2024-10-27 00:27:29
ASP.NET MVC场景,类似于StackOverflow上的“发布您的答案”(ASP.NET MVC scenario, similar to 'Post your answer' on StackOverflow)

我有要求将评论系统添加到页面(类似于任何SO问题底部的“发布您的答案”)。 实现这个的最佳方式是什么? 我应该使用Ajax渲染局部视图还是应该将Json数据传递给服务器? 在后一种情况下,我不太清楚应该如何在现有评论底部添加新增评论。

我对ASP.NET MVC非常陌生,并且对AJAX模式感觉不太好。 另外,我听说,不引人注意的JavaScript的支柱是,您的页面应该先用JavaScript开发,并且功能齐全,只有在开发者添加JavaScript并增强体验之后。 这是否正确,在上述特定情况下是否属实?

谢谢。

PS。 我正在使用jQuery。

I have a requirement to add commenting system to a page (similar to 'Post your answer' at the bottom of any SO question). What is the optimal way to implement this? Should I render the partial view with Ajax or should I just pass the Json data to server? In the latter case I don't quite get how I should add newly added comment to the bottom of existing comments.

I'm very very new to ASP.NET MVC, and don't quite feel solid with ajax patterns. Also, I heard, that the pillar of unobtrusive JavaScript is that your page should be first developed w/out JavaScript and be fully functional and only after that developer should add JavaScript and enhance the experience. Is this generally true and is this true in above particular case?

Thank you.

PS. I'm using jQuery.

最满意答案

观看Phil Haack的PDC演示,他在那里构建HaackOverflow :)

在这里获取视频: http : //channel9.msdn.com/pdc2008/PC21/

他演示了如何使用内置的AJAX功能提交问题,并将其自动添加到现有问题的底部。

Watch Phil Haack's presentation for PDC, where he builds HaackOverflow :)

Get the video here: http://channel9.msdn.com/pdc2008/PC21/

He demonstrates using the built-in AJAX functionality to submit a question, and have it automatically added to the bottom of the existing questions.

更多推荐

本文发布于:2023-07-07 09:06:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1061409.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:您的   类似于   场景   答案   ASP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!