开发者

Advice on a web application architecture using Web Forms or MVC

I would like some opinions on the following approach to architecting a web application.

A user will navigate to a login page. After logging in, the user will be sent to what I will call a primary page. The idea is to have the primary page contain some common material at the top of the page along with a menu. Below the menu taking up the majority of the page is an IFrame. Each of the menu items, when selected, would load the appropriate page into the IFrame. Here is the开发者_StackOverflow中文版 main point. The user can navigate through the application using the various menu selections and carry out whatever those selections allow while the primary page remains loaded during the entire session, that is, until the user logs out or closes the browser. This approach does not follow what appears to be the more common paradigm where the browser completely replaces web pages with other web pages as the user navigates through the site. No page stays loaded during the entire session. Is leaving the primary page loaded during the entire session a good idea?

If not, what are the main concerns? Also, can you site any references to a different approach to accomplish the same application-like behavior?

If okay, is there any advantage to using MCV over Web Forms to obtain this behavior?


majority of the page is an IFrame

Iframes are bad. They always have been bad, they always will be. There a dirty hack.

Don't use iframes.

SPA

If you have a good reason not to use actual pages and redirects you can try one of those single page applications that seem to be popular.

I will however remind you that if you rely javascript you basically can't do SEO.

Progressive enhancement

As an aside read up on Progressive Enhancement. You should be doing that.

Partial views

If you like having a large portion of your website static then you can always load partial views over ajax and render them on the client.

Of course because your doing progressive enhancement your doing full page redirects and loads aswell. The partial view rendering on the client is just bells and whistles.

.NET

As for using C# frameworks I would personally recommend Nancy.

If you want to use ASP (god knows why) I guess you can use ASP.NET MVC, sure it's far from optimum but at least it's not ASP.NET webforms


I don't think it's the absolute evil, but your solution does not actually follow the "normal" behaviour of an HTML site, and browsing may be less intuitive.

  • Users will have problems for bookmarks or using back button, for example.
  • You will not be able to adapt the menu accoring to the current displayed content (or will have a hell of synchro problems!), for example showing wich section you are in.

The common solution for web is to use a layout, or two-step view pattern (see http://framework.zend.com/manual/en/zend.layout.introduction.html)

I don't know well webforms, but MVC is known as the standard de facto for most web applications and frameworks. It's nice because of the splitting of the roles and the organization it enforces.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜