iframe的好坏对我的MVC Web应用场景 [英] iframe good or bad for my MVC web-app scenario

查看:115
本文介绍了iframe的好坏对我的MVC Web应用场景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直工作到内网的网络解决方案,是由一组特定的系统用户的使用 - 像供应链管理。没有SEO或市场营销 - 只有易用性和简单性,呼吁他们,使他们的任务变得简单。

我使用MVC2与ASP.Net。我将解释在通用术语我的情况。我已经有一个标签视图的页面。第一个标签加载从主表中的记录和一些细节表中的其他标签加载数据。而理想的例子是这样的:


  

      
  • 标签1:添加/编辑客户(主)记录

  •   
  • 标签2:添加/编辑订单的客户

  •   
  • 标签3:订单添加/编辑项目(取决于卡2)

  •   
  • 标签4:添加/​​编辑不同的地址为客户

  •   

我使用jQuery UI选项卡。现在按我的iframe的知识 - 如果我设计这个页面(视图),包括第一个标签及其在一个页面(视图)内容和标签的其余的都在我使用单独的页面(查看)iframe中。总之 - 所有的相关标签将有自己单独的页

好处我见 -


  

      
  1. 页面变得v.light和快速,因为用户在工作时
      标签1其他选项卡将加载
      他们的iframe中。

  2.   
  3. 在功能上,每个标签都必须有自己的添加/编辑,并列出独立。
      例如,如果我加入地址
      那么只有我的地址的iframe会
      刷新和的休息
      选项​​卡/页不必回发
      重新加载数据。

  4.   
  5. 有一个通用的保存/取消的功能将需要v.complex
      在存储器中的对象的高速缓存
      层次,如果一切是在一个单一的
      页面(查看)。我可以使用用户控件
      (即的.ascx),但仍在处理
      一切都在一个单一的动作是一样
      巨大的&安培;复杂的。

  6.   
  7. 我不用担心搜索引擎优化或书签或动态尺寸。
      相反,我得到SOC(分离
      关注),一切都被
      分布式v.well和主要的事情
      是,它变得非常快
      的回传是分开的。

  8.   

..这一切如果我使用iframe的:)不过,我没有看到很多人都喜欢像内部框架:
是iFrame的可怕的想法?

如果这样 - 有一个等效的jQuery选择吗?我希望它有iframe和ATLEAST功能的好处通过URL和独立的回传动态加载的内容。我并不想创建一个AJAX凌乱BLOB,它可以处理的事情,但让后端同样复杂。


  

请让我知道你的想法 - 我
  不想知道有多好/坏
  iframe会,我只是想知道是什么
  适合我的要求,如果有一个
  更好的替代内部框架为..
  我的方案。


编辑#1:我的IFRAME支持的浏览器列表 -

http://www.webmaster-resources101.com/articles/view/417 /

编辑#2:我得到的东西,可能是对iframe的更好optioninstead的垫脚石 -

它是一种在两个jQuery插件的组合是著名的jQuery插件标签,另一个是计划外插件,它可以控制容器的回发。


  

jQuery用户界面标签:
   http://jqueryui.com/demos/tabs/


  
  

jQuery的劫持:
   HTTP://$c$c.google.com/p/jquery-hijack/


能否这项工作?像这样的任何其他更好的选择?


解决方案

我只好下车这篇文章来完成它 - <一个href=\"http://stackoverflow.com/questions/6584632/alternative-for-iframes-for-jquery-ui-tabs-plugin-with-support-for-postback\">Alternative对于内部框架的jQuery UI选项卡插件 - 与回发支持

因为它带来了在presentation层业务对象级别的细节我并不想完全JSifiedAJAX示范基地的处理。因此,要保持它的抽象最后我用一个jQuery插件jquery.forms.js它允许ajaxify我的形式。

与MVC的局部视图的概念,我能够实现完整的AJAX回传解决方案(没有使它复杂或把我的模型级处理在客户端作为knockoutjs特点,骨干等..组合(他们再伟大的,但我想保持的东西简单,控制(服务器端))

感谢您。

I've been working into intranet web solutions which are to be used by a specific set of users of a system - like supply chain management. No SEO or marketing - only easy of use and simplicity that appeals them and makes their task simple.

I'm using MVC2 with ASP.Net. I'll explain my scenario in generic terms. I've a page which has a tab view. The first tab loads a record from a master table and the other tabs load data for some details table. And ideal example would be like:

  • Tab 1: Add/Edit Customer (master) record
  • Tab 2: Add/Edit Orders for a Customer
  • Tab 3: Add/Edit Items for an Order (depends on tab 2)
  • Tab 4: Add/Edit different addresses for that Customer

I'm using jQuery ui tab. Now as per my knowledge of iframes - if I design this page(View) to include the first tab and its contents in one page(View) and the rest of the tabs have iframe in which I use separate pages(Views). In short - all the dependent tabs will have their separate pages.

The benefits I see -

  1. The page becomes v.light and fast because while the user is working on tab 1 the other tabs will be loading their iframe.
  2. Functionally, each tab has to have its own Add/Edit and list independent. For example if I'm adding addresses then only my address iframe will be refreshed and the rest of the tabs/pages need not postback and reload the data.
  3. Having a universal save/cancel feature would require a v.complex in-memory caching of the object hierarchy if everything is in a single page(View). I can use user-controls (i.e. .ascx) but still processing everything in a single action is like huge & complex.
  4. I need not worry about SEO or bookmarks or dynamic dimensions. Instead I'm getting SOC (Separation of concerns), everything is being distributed v.well and the main thing is that it becomes extremely fast as the postbacks are separate.

.. all this if I get to use iframes :) However, I don't see many people like iframes like: Are iframes a terrible idea?

If so - is there an equivalent jQuery alternative? I'd expect it to have the benefits of iframe and atleast the feature to load the content dynamically via url and separate postbacks. I don't want to create a messy AJAX blob which can handle things but make the backend equally complex.

Kindly let me know your thoughts - I don't want to know how good/bad iframes are, I just want to know what suits my requirements and if there's a better alternative to iframes .. for my scenario.

EDIT #1: I got a list of iframe supporting browsers -

http://www.webmaster-resources101.com/articles/view/417/

EDIT #2: I got something that might be a stepping stone towards a better optioninstead of iframe -

Its a combination of two jQuery plugins on is the famous jQuery tabs plugin and another is the adhoc plugin which can control the postback of a container.

jQuery ui tab: http://jqueryui.com/demos/tabs/

jquery-hijack: http://code.google.com/p/jquery-hijack/

Can this work? Any other better options like this?

解决方案

I had to get off this post to complete it - Alternative for iframes for jQuery ui tabs plugin - with support for postback

I didn't wanted a fully "JSified" ajax base model handling because it brings the business object level details in the presentation layer. So, to keep it abstract I ended up using a jQuery plugin jquery.forms.js which allows to ajaxify my forms.

Combined with the "partial view" concept of MVC I was able to achieve a complete AJAX postback solution (without making it complex or bringing my model level handling on client side as features in knockoutjs, backbone, etc... (they're great but I wanted to keep thing simple and in control (on server side))

Thank you.

这篇关于iframe的好坏对我的MVC Web应用场景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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