E
Elsa Luiz
Hi everyone,
I have this problem hope you could help me...
I have an A.aspx page with a button, when I click the button I would
like to open another window with containing B.aspx. The problem is
that the window B.aspx appears fine but the focus returns to the
parent (A.aspx), I would like the focus in B.aspx window.
When I click the button on A.aspx I execute the following code:
private void btMyButton_Click(object sender, System.EventArgs e)
{
Session["LineFileCode"] = tbLineFileCode.Text.Trim();
OpenWindow("B.aspx");
}
OpenWindow his a method:
public void OpenWindow(string strURL)
{
string sb;
sb = "<script language=javascript>";
sb = sb + "w=window.open('" + strURL + "','PopUp',
'width=200,height=200,scrollbars=yes,toolbar=no,menubar=no');";
sb = sb + "w.focus();";
sb = sb + "</script>";
if (!this.IsStartupScriptRegistered("OpenWindow"))
{
this.RegisterStartupScript("OpenWindow", sb.ToString());
}
}
Can you please give me some clue of what am I doing wrong?
Thanks a lot in advance!
Elsa
I have this problem hope you could help me...
I have an A.aspx page with a button, when I click the button I would
like to open another window with containing B.aspx. The problem is
that the window B.aspx appears fine but the focus returns to the
parent (A.aspx), I would like the focus in B.aspx window.
When I click the button on A.aspx I execute the following code:
private void btMyButton_Click(object sender, System.EventArgs e)
{
Session["LineFileCode"] = tbLineFileCode.Text.Trim();
OpenWindow("B.aspx");
}
OpenWindow his a method:
public void OpenWindow(string strURL)
{
string sb;
sb = "<script language=javascript>";
sb = sb + "w=window.open('" + strURL + "','PopUp',
'width=200,height=200,scrollbars=yes,toolbar=no,menubar=no');";
sb = sb + "w.focus();";
sb = sb + "</script>";
if (!this.IsStartupScriptRegistered("OpenWindow"))
{
this.RegisterStartupScript("OpenWindow", sb.ToString());
}
}
Can you please give me some clue of what am I doing wrong?
Thanks a lot in advance!
Elsa