Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

XML
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
C#
$('#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??
Posted

1 solution

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.
HTML
<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>
 
Share this answer
 
v3
Comments
Member 9293061 17-Aug-12 6:52am    
gyugygy
Member 9293061 17-Aug-12 6:52am    
jvgjvgu
Member 9293061 17-Aug-12 9:58am    
dcfrfcrhycfrcfry
Member 9293061 17-Aug-12 9:58am    
hkhnuhnkiyi

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900