Hi Ali,
Thanks for your response. Well I'll paste the page's source here:
---------------------------aspx----------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>OpenWindow</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="
http://schemas.microsoft.com/intellisense/ie5">
<script language="javascript">
function openwindow(url)
{
lnkNewWindow.href = url;
lnkNewWindow.click();
}
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<table width="100%" align="center">
<tr>
<td>
<asp:Label id="lblMessage" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Button id="btnPostBack" runat="server"
Text="PostBack"></asp:Button></td>
</tr>
<tr>
<td>
<a id="lnkNewWindow" href="
http://www.asp.net" target="_blank"
style="DISPLAY:none"></a>
</td>
</tr>
</table>
</form>
</body>
</HTML>
-----------------------------------aspx.cs page
class----------------------------------------
public class OpenWindow : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button btnPostBack;
protected System.Web.UI.WebControls.Label lblMessage;
private void Page_Load(object sender, System.EventArgs e)
{
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.btnPostBack.Click += new
System.EventHandler(this.btnPostBack_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void btnPostBack_Click(object sender, System.EventArgs e)
{
lblMessage.Text = "Button is clicked at: " +
DateTime.Now.ToLongTimeString();
string sb = "<script language='javascript'>openwindow('{0}');</script>";
sb = string.Format(sb,"
http://www.microsoft.com");
Page.RegisterStartupScript("startscript",sb);
}
}
-------------------------------------------------------------------
If you have any further questions or anything unclear, please feel free to
post here.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx