替代内置页框的jQuery UI选项卡插件 - 与回发支持 [英] Alternative for iframes for jQuery ui tabs plugin - with support for postback

查看:184
本文介绍了替代内置页框的jQuery UI选项卡插件 - 与回发支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

其实,这是一个问题,我张贴在过去关于IFRAME一个更具体的版本 -

  

<一个href="http://stackoverflow.com/questions/6421989/iframe-good-or-bad-for-my-mvc-web-app-scenario">iframe好还是坏我的MVC Web应用程序内的情况

以上后最终进入更加倾向于内置页框都坏的地方,我实际上是在寻找一个坚实的IFRAME当量(如果内置页框是非常糟糕的我的方案)。他们几乎绞死我:)但我只是想获得一个更好的选择。有人建议我考虑一个AJAX库,将使MVC处理上的客户端,太复杂。该职位仍然冻结。

总之,让我简化。我使用jQuery UI选项卡插件显示选项卡视图。我想孤立标签内容的网页,因为他们管理(添加\编辑)独立的实体。每个标签回发/验证有被孤立 - 让在标签加工过程中不打扰另一个。内置页框所服务的宗旨v.well,我已经处理的问题,如会话超时等。但是专家表示,内置页框是坏',所以我已经开始寻找替代品。希望你明白我想要什么 - 替换为IFRAME的隔离功能

我这里还有备选方案,我发现 -

  1. jQuery UI的标签确实允许,如果我们在更好的选择指定它的iframe动态加载? 这是完美的,直到我被困到交叉表验证问题不像的iframe,这不是孤立的,并在回发一个标签试图回传整个页面(即所有选项卡)。

  2. 有关在(1)中提到的问题,我遇到了一个插件,它能够回发限制在一个容器中。 ( jQuery UI的选项卡+ jQuery的-hyjack )看起来有希望的 - HTTP://$c$c.google.com/p/jquery-hijack/

  3. 我有吨像内联解决方案的标签的DIV的渲染,服务器端包含等。但是这把我带回到隔离原来的问题。一个选项卡的回发/验证触发验证的其他选项卡。此外,我不喜欢装,因为回发在一个选项卡(其他选项留不受影响)的整个页面的想法。

  4. 有人说这工作得更好,然后IFRAME -

  

对象   CLASSID =CLSID:25336920-03F9-11CF-8FD0-00AA00686F13   TYPE =text / html的数据=xpto.html   WIDTH =300HEIGHT =300>

(5)。我已经通了一些流行的博客,论坛上找到iframe的问题,如 - http://www.mediacollege.com/internet/html/frames/pros -cons.html (其有关框架,但它的一些应用中的iframe为好)

  

如果我不关心搜索引擎优化,   链接/书签,我已经处理了   IFRAME导航,安全性和   会话超时/重定向问题 -   做的内置页框仍资格为我   情景?

请建议,并提供价值的解决方案。

支持iframe的信息有些链接:

解决方案

由于您使用ASP.NET MVC(基于其他职位),你必须在表单标签控制,如果你包围在它自己的形式每个标签标签,你将在每次回发使得它'孤立'你预想的方式选项卡的具体领域,但它仍然是一个完整的信息页面 - 看来你是坚持一点点的WebForms的口头禅这是可以理解的

您也可以在标签序列化JSON + jQuery的标签特定领域,并创建在使用AJAX来像一个ASHX / REST的API能够处理您的验证另一个端点飞后。

编辑:在IFRAMES寿,如果您正在使用的标签就意味着你应该在同一环境下谈论的信息,那么搜索引擎优化和所有的不应该是一个问题。在我的(企业内部网)的应用程序的所有弹出窗口我目前的工作是内部框架,但你必须考虑设计为那些在返回按钮很多。

Actually this is a more specific version of a question I posted in past regarding iframe -

iframe good or bad for my MVC web-app scenario

The above post ended up into being more inclined towards "iframes are bad" where as I was actually looking for a solid iframe equivalent (if iframes are really bad for my scenario). They almost hanged me :) but I was just trying to derive a better alternative. Some suggested me to consider an AJAX library which would bring the MVC processing on client-side, too complex. The post is still frozen.

Anyway, let me simplify. I'm using jQuery UI tabs plugin to display a tab-view. I want to isolate the tab content pages because they manage (add\edit) separate entities. Each tab postback/validation has to be isolated - so that processing in a tab doesn't 'disturb' the other one. iframes are serving the purpose v.well and I've already handled the issues like session timeout, etc.. but experts say 'iframes are bad' so I've started looking for alternatives. Hope you've understood what I want - a replacement for iframe for isolated functionality.

Here're some alternatives I've found -

  1. jQuery UI tabs does allow dynamic loading if we specify it in Better alternative to an iframe? This was perfect until I got stuck into cross tab validation issues unlike iframe this is NOt isolated and postback in one tab tries to postback the whole page (i.e. all the tabs).

  2. For the problem mentioned in (1.) I came across a plugin which is able to limit the postback to a container. (jQuery UI tab + jquery-hyjack) Looks promising - http://code.google.com/p/jquery-hijack/

  3. I've got tons of solutions like inline rendering of tabs in DIV, server-side includes, etc.. but this takes me back to the original issue of isolation. Postback/validation of one tab triggers validation in other tabs. Also I don't like the idea of loading the whole page because of postback in a single tab (other tabs stay unaffected).

  4. Some say this works better then iframe -

object classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13" type="text/html" data="xpto.html" width="300" height="300">

(5.) I've gone thru some popular blogs, forums to find the issues of iframe like - http://www.mediacollege.com/internet/html/frames/pros-cons.html (its about frames but some of it applied to iframe as well)

If I'm not concerned about SEO, linking/bookmarks and I've handled the iframe navigation, security and session timeout/redirection issues - do the iframes still disqualify for my scenario?

Please suggest and provide a worth solution.

Some links for iframe info:

解决方案

Since you are using ASP.NET MVC (based on the other post), you have control over the Form tag, if you enclose each tab within it's own form tag you will have tab-specific fields in each Postback making it 'isolated' the way you envisioned, but it is still a full post in the page -- it seems you are stuck a little with the WebForms mantra which is understandable.

You could also serialize the tab-specific fields in JSON + jQuery in a tab and create a post on the fly using an AJAX to another endpoint like an ASHX/RESTful API able to handle your validation.

EDIT: on the IFRAMES tho, if you are using tabs it means you should be talking about information under the same context, then SEO and all that should not be an issue. All popups in my (intranet) app I work at the moment are iframes, but you have to think about the back button a lot when designing for those.

这篇关于替代内置页框的jQuery UI选项卡插件 - 与回发支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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