MVC3弹出页面需要帮助 [英] MVC3 Popup page Help Required

查看:67
本文介绍了MVC3弹出页面需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在ASP.net MVC3中开发一个应用程序,我正在使用OAuth 2.0与yahoo进行连接,点击它后,我的cshtml页面(例如abc.cshtml)上会有一个超链接,我正在打开一个弹出页面,其中雅虎登录(即在yahoo.com上)成功登录后,它在同一弹出窗口上显示联系人列表

我想在存在我的超链接的同一页面上显示联系人列表(即abc.cshtml)

我希望当我成功登录yahoo时,弹出窗口应关闭并且列表应显示在abc.cshtml

I''m developing an application in ASP.net MVC3, i am using OAuth 2.0 to connect with yahoo i have a Hyperlink on my cshtml page(eg abc.cshtml) on clicking it i am opening a popup page which of yahoo login(ie on yahoo.com) after loging successfully it is showing contacts list on the same popup window

I want to display the contact list on the same page where my Hyperlink is present(ie abc.cshtml)

I want that when i login to yahoo successfully the popup window should closed and the list should display on abc.cshtml

This is my button
<a id="OpenWinYahoo" title="login with yahoo">
                        @*href="/InviteFriends/YahooContact">*@
                        <img src="../../Content/images/yahoo_invite.jpg" class="inviteimg" /></a>




这是我的开窗器




This is my window opener

$('#OpenWinYahoo').live('click', function () {
      window.open("/InviteFriends/YahooContact", "MyWindow", 'left=350,top=250,menubar=0,resizable=0,location=1,toolbar=0,status=1,scrollbars=1,width=600,height=455')
  });



我如何关闭弹出窗口并返回包含列表的视图?



How can i close the popup and return to view containing the list??

推荐答案

(' #OpenWinYahoo').live(' 点击' , 功能 () { window.open(" " MyWindow" left = 350, top = 250,menubar = 0,resizable = 0,location = 1,toolbar = 0,status = 1,scrollbars = 1,width = 600,height = 455') });
('#OpenWinYahoo').live('click', function () { window.open("/InviteFriends/YahooContact", "MyWindow", 'left=350,top=250,menubar=0,resizable=0,location=1,toolbar=0,status=1,scrollbars=1,width=600,height=455') });



我如何关闭弹出窗口并返回到包含列表的视图?



How can i close the popup and return to view containing the list??


我假设如果您没有控制InviteFriends/YahooContact页面,那么此修复将不起作用.如果您无法控制页面,我建议您调查Yahoo是否提供API,以便您可以控制窗口并仅调用其服务.可能有更好的方法来执行此操作.这只是我使用的方法.

在InviteFriends/YahooContact页面中,放置此脚本.从您的登录按钮调用它.
I am assuming that you have control over the InviteFriends/YahooContact page if not then this fix will not work. If you don''t have control over the page I would suggest looking into if Yahoo offers an API so you can control the window and just call their service. There may be a better way to do this. This is just the method that I use.

In the InviteFriends/YahooContact page put this script. Call it from your login button.
<script type="text/javascript">
     function Login() { 
          //Put logic to log into Yahoo here.
          if('loggedinSuccess' == true) { 
               window.parent.location = 'Put the redirect URL here';     
               window.close;
          }
     }
</script>


这篇关于MVC3弹出页面需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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