I have a page that displays some content inside a lightbox, within this content there is a Button (btnAccept) to confirm. I want to refresh the page and open a new window(or the other way around) all this from codeBehind (c#) . I will appreciate any help.
this is what I tried so far:
First attempt: I am able to open a new window but I CAN'T refresh the page
protected void btnAccept_Click(object sender, EventArgs e)
{
//to open the new tab
Response.Redirect(URL, true);
//to refresh the page
Page.Response.Redirect(HttpContext.Current.Request.Url.ToString(), true);
}
Second attempt: I am able to open a new window but I CAN'T refresh the page
protected void btnAccept_Click(object sender, EventArgs e)
{
//to open the new tab
ScriptManager.RegisterStartupScript(Page, typeof(Page), "OpenWindow", "window.open('URL');", true);
//to refresh the page
Page.Response.Redirect(HttpContext.Current.Request.Url.ToString(), true);
}
if I change the order i will refresh the page but WILL NOT open a new page