Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How To Close Popup Window And Redirect To Parent Window
WhatsApp
Khumana Ram
9y
41.6
k
0
2
25
Blog
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);
How To Close Popup Window And Redirect To Parent Window
Up Next
Show ADFS Login page instead of Windows authentication pop up
Ebook Download
View all
.NET Interview Questions and Answer: Practical Implementation
Read by 41.9k people
Download Now!
Learn
View all
Membership not found