EDUDOTNET

Thursday, February 13, 2014

How To Close Popup Window And Redirect To Parent Window

When we click login Facebook redirect to in the popup.But we need to redirect from popup window to parent window after that close popup when user click on login/allow button.

We can use for this ClientScript.RegisterStartupScript function and write java-script code and after that it`ll be close automatically.

Below code we can use where we need to open & close popup from code (C#)

Code:

Function
public void RedirectToParent(string url, Type type)
        {
            string js = "";
            js += "window.opener.location.href='" + url + "';";
            js += "window.close();";
            ClientScript.RegisterStartupScript(type, "redirect", js, true);

        }



Calling Function

Type type = this.GetType();
RedirectToParent("http://www/xyz.co/...", type);

1 comments:

  1. Send Unlimited Marketing Mails?
    It's 100% Cheap & Inbox Guaranteed Delivery.

    Take 14 Days Free Trial.
    Add 1000 contacts & send unlimited campaigns.

    Visit: http://j.mp/outboxmailer-affiliate-004 at Just $59/month

    - You can ADD UNLIMITED CONTACTS
    - You Can SEND UNLIMITED MailS without limits.
    - Custom HTML editor, Web forms, Follow ups, and Auto-Responder.
    - 99.5% Inbox Delivery and Real time reporting.
    - Simple and Easy.

    USE COUPON CODE & SAVE 50%: MADOFFER786

    Take 14 Days Free Trial.
    Add 1000 contacts & send unlimited campaigns.

    In other network, they are charging +1000 USD for 1 Million Mails / contacts.
    But in http://j.mp/outboxmailer-affiliate-004 is cheap at Just $59/month.?

    ReplyDelete