Click here to Skip to main content
15,896,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to open a new window page when user clicked on the graph?
Thanks..
Posted

On chart click, write this:
C#
Response.Write("<script>");
Response.Write("window.open('somepage.aspx','_blank')");
Response.Write("</script>");


-KR
 
Share this answer
 
Window.Open method[^] should help you open a new window.
 
Share this answer
 
C#
string url = "window_page";

              string fullURL = "window.open('" + url + "'  );";
              ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true);


Improved Solution

                string fullURL = "window.open(' http://www.google.de ' , 'width=1003,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no' );";
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true);
 
Share this answer
 
v3
Comments
KyLim0211 12-Oct-15 1:55am    
<asp:Chart ID="Core_Chart" runat="server" Width="667px" Height="540px" ToolTip="Core Chart" onClick="btnSearch_Click" ChartType="" BorderlineColor="Maroon" BackColor="WhiteSmoke" Palette="SeaGreen" Style="margin-top: 0px">

protected void btnSearch_Click(object sender, System.EventArgs e)
{
string url = "http://www.google.de";

string fullURL = "window.open('" + url + "' );";
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true);
}

not working ,when i clicked on the graph area
Arasappan 12-Oct-15 2:11am    
What Is shown on url content
Arasappan 12-Oct-15 2:14am    
Please See My Improved Solution
KyLim0211 12-Oct-15 2:41am    
http://imgur.com/7gLQYSS

tried ur code,when i click on the chart area,ntg popup

<asp:Chart ID="Core_Chart" runat="server" Width="667px" Height="540px" ToolTip="Core Chart" onClick="btnSearch_Click" ChartType="" BorderlineColor="Maroon" BackColor="WhiteSmoke" Palette="SeaGreen" Style="margin-top: 0px">

<pre lang="cs">protected void btnSearch_Click(object sender, System.EventArgs e)
{
string fullURL = "window.open(' http://www.google.de ' , 'width=1003,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no' );";
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true);
}
</pre>
KyLim0211 12-Oct-15 2:42am    
this method works well but it will redirect to other page,cannot use for new window popup..too bad

protected void showtooltip()
{
foreach (Series series in Core_Chart.Series)
{

series.ToolTip = "Number of Risk: #VALY";
Core_Chart.Series["Low"].Url = "NewChart.aspx";
Core_Chart.Series["Moderate"].Url = "NewChart.aspx";
Core_Chart.Series["High"].Url = "NewChart.aspx";
Core_Chart.Series["Openn"].Url = "NewChart.aspx";
}

}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900