(沮丧)找到在ASP.NET MVC中创建类似门户网站(带有Portlet)的正确方法 [英] (Frustration) Finding the right way to create portal-like site (with portlets) in ASP.NET MVC

查看:62
本文介绍了(沮丧)找到在ASP.NET MVC中创建类似门户网站(带有Portlet)的正确方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的思想真的要爆发了,我感到非常沮丧.我已经在网上搜索了1周的相关信息,发现该主题存在很多矛盾,我不知道哪种方法是正确的.

My mind is really going to explode and I am so frustrated. I have been searching the net for 1 week now about this and I see a lot of contradiction on the subject and I don't know which method is the right one.

<%= Html.RenderUserControl(〜/Gravatar/GravatarImage.ascx")%>但是在评论中,人们对使用背后的代码感到愤怒,并且人们在谈论打破MVC模式和可测试性.

<%=Html.RenderUserControl("~/Gravatar/GravatarImage.ascx")%> but in comments people are raging about code behind usage and people are talking about breaking MVC Pattern and Testability.

这篇文章这个家伙提出了Partialrequests,但又有人在谈论打破MVC模式和可测试性.

in this article the guy suggests Partialrequests but again some people are talking about breaking MVC Pattern and Testability.

and in this article the guy is suggesting a way to create templates but it is not working anymore.

然后有子控制器,渲染动作等...

then there are Sub Controllers, Render Action, etc...

这真的很令人困惑,让我想自杀.我真的很喜欢MVC的简单性,但似乎创建共享实体是某种火箭科学.真的那么难还是我错过了什么吗?

This is really confusing and makes me want to kill my self. I really got attached to the simplicity of MVC but it seems that creating shared Entities is some kind of rocket science; is it really that hard or am I missing something?

我想要的很清楚;我有一个门户网站,例如

What I want is very clear; I have a portal site where for example

  • 您在博客页面中,但是在右列中,您列出了IMDB服务或其他最新电影.
  • 我要登录,并在所有页面中加入新闻信.
  • 根据某些逻辑或请求加载这些模块的能力.
  • 能够异步加载这些小Portlet或实体(加载Progress GIF)

当然,这些要求与当前页面视图或其控制器无关(这就是您可以将其混搭的Portal网站的整个想法).在Web窗体中,您只需创建一个该死的用户控件,然后将其拖动到页面(母版页)即可.地狱,您甚至可以根据特定逻辑动态加载它们.

Of course, these requirements don't relate to the current page view or their controller (that is the whole idea of Portal site you can mash and mix). In Web Forms you just create a damn user control drag it to the page, Master page and you are done; hell, you can even load them dynamically based on specific logic.

因此,如果有人能告诉我如何在不破坏MVC的前提下实现这种功能而又不违反牛顿定律或爱因斯坦定律的情况下,我想很多人都和我一样,所以我认为答案将使我们很多人受益.

So please if someone can tell me how to achieve this kind of functionality without breaking Newton's or Einstein's Laws with MVC, and I think many people are like me in the same boat, so I think answers will benefit a lot of us.

推荐答案

如果您不是mvc的纯粹主义者,我认为这是最好的解决方案 http://blog.codeville.net/2008/10/14/partial-requests-in-aspnet-mvc/我

I think it's the best solution if you aren't mvc purist http://blog.codeville.net/2008/10/14/partial-requests-in-aspnet-mvc/ I

这篇关于(沮丧)找到在ASP.NET MVC中创建类似门户网站(带有Portlet)的正确方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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