模态弹出使用AJAX,更新面板,jQuery的出或Javascript成为令人惊讶的,这似乎工作 [英] A modal popup with out using ajax, update panel, jquery or javascript- surprisingly this seems to work

查看:144
本文介绍了模态弹出使用AJAX,更新面板,jQuery的出或Javascript成为令人惊讶的,这似乎工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

被用尽各种后背面和模式弹出相关的其他问题之后(AJAX / jQuery的/ JavaScript的),我们想出了一个简单的把戏,这似乎是工作的罚款为止。我们在其他数以百计的ASPX文件来实现这一点,我们担心这种解决方案可能会拿出在未来的一个问题,到目前为止还没有为我们所知。如果有人可以指出可能存在的问题,我们真的会AP preciate了。

After being exhausted with various post back and other issues related to modal popup ( ajax/jquery/javascript) we came up with a simple trick that seems to be working fine so far. We are to implement this in hundreds of other aspx files and we are afraid that this solution might come up with a issue in future so far not known to us. If some one can point out the potential issues we would really appreciate that.

在点击链接,这是code,它会调用一个伪弹出: 见这个弹出行动 http://02e34b5.netsolhost.com/youtube/Zpopup.aspx

On button click this is the code that fires up a pseudo popup: See this popup in action http://02e34b5.netsolhost.com/youtube/Zpopup.aspx

<asp:Panel ID="pseudopopup" runat="server" visible="false">
 <table style="position: fixed; z-index: 1; left: 0px; top: 0px"   border="0"  width="100%" height="100%">

// position fixed is essential. div wont extend 100% in height but an html table would
// no background color hence everything behind tbl is visible but NOT clickable 

    <tr>
        <td valign="top"  align="center" >

// this would put a nice center aligned div with css shadow helping give it a popup shape

        <div style=" width: 1000px;  margin-top:80px; padding:10px;  background-color: #FF00FF" id="layer2" class="roundshadow">
        Grid goes here
                 Form view goes here
                other stuff goes here
                no need to worry about the postback

             close button goes here that makes the panel visible = false

 </div>
        </td>

    </tr>
    </table>
   </asp:Panel>

这是迄今为止在与出任何问题。 见这个弹出行动 http://02e34b5.netsolhost.com/youtube/Zpopup.aspx

This has been so far working with out any issues. See this popup in action http://02e34b5.netsolhost.com/youtube/Zpopup.aspx

推荐答案

这将工作,当然,但也有一些如果秒。作为一个纯粹的服务器端方法,这有这种方法的所有缺点和优点。

It will work of course, but with some ifs. As a pure server-side method, this has all the cons and pros of such an approach.

优点:

  • 更容易实现。有关客户端脚本无后顾之忧。
  • 在任何你需要的是可在服务器端。您不需要做额外的请求从服务器获取数据。
  • 有没有脚本的兼容性问题,可以在任何浏览器。
  • 无需学习JavaScript。服务器端语言(C#,VB)就足够了
  • 无需学习HTML DOM或任何其他客户端框架。只是asp.net

缺点:

  • 在回发是昂贵的,消耗了大量的资源在服务器上。这将成为一个严​​重的问题,当并发请求的数目增加。你将不得不雇用一个足智多谋的Web服务器(更好的CPU,更大的内存,更强大的网络连接,...)
  • 这比因为往返到服务器的客户端侧的弹出窗口慢。
  • 用户不能玩这个对话框。如移动,调整大小,保持固定的动作,...实际上是不可能的。
  • 作为页面的增长,你将面临的ViewState 这使得巨大的页面的问题。
  • 这是出过期的解决方案。没有人喜欢它了,人们(用户和同事)将开始喊你实现这样的事情。
  • 如果服务器需要从客户端的任何数据(窗口大小,....),你应该将它们和你的请求发送。
  • Postbacks are expensive and consume a lot of resources on the server. This will become a serious problem when the number of concurrent requests grow. You will have to employ a resourceful web server (better CPU, more RAM, more powerful Network connection, ...)
  • This is slower than a client-side popup window because of the round-trip to the server.
  • The user can't "play" with this dialog. Actions like moving, resizing, keeping fixed, ... are practically impossible.
  • As the page grows, you will face the problem of ViewState which makes the pages huge.
  • This is an out-of-date solution. Nobody likes it anymore and people (users and coworkers) will begin to shout at you for implementing something like this.
  • If the server needs any data from the client-side (window size, ....), you should send them along with your request.

结论:

  • 只有当你有一个内联网网站的点击量较低少数用户使用此方法。
  • 切勿将其用于真实世界的互联网网站。

这篇关于模态弹出使用AJAX,更新面板,jQuery的出或Javascript成为令人惊讶的,这似乎工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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