C# MS Chart的Response.redirect

C# MS Chart的Response.redirect,c#,asp.net,response,mschart,C#,Asp.net,Response,Mschart,我有一个图表控件 现在,我想要的功能是,如果用户单击图表,它会将图表带到一个新页面,我需要向该页面发送一个值 我试过了,但连按都不起作用 protected void Chart1_Click(object sender, ImageMapEventArgs e) { if (Label1.Text != "1") { Response.Redirect("~/Admin/Page2Chart.aspx?

我有一个图表控件

现在,我想要的功能是,如果用户单击图表,它会将图表带到一个新页面,我需要向该页面发送一个值

我试过了,但连按都不起作用

   protected void Chart1_Click(object sender, ImageMapEventArgs e)
    {           
        if (Label1.Text != "1")
        {
            Response.Redirect("~/Admin/Page2Chart.aspx?node=" + Label1.Text);
        }
        else
        {
            Response.Redirect("~/Admin/Page2Chart.aspx");
        }

    }
我知道我们可以在Html中添加URL,但我不能在其中添加条件

任何帮助都将不胜感激

谢谢

<asp:Chart ID="Chart4" Height="202px" Width="360px" runat="server" 
                            onclick="Chart4_Click" >
                            <Series>

                                <asp:Series ChartType="Pie" Name="Series1" Font="Microsoft Sans Serif, 10pt" >
                                </asp:Series>
                            </Series>
                            <ChartAreas>
                                <asp:ChartArea Name="ChartArea1">
                                </asp:ChartArea>
                            </ChartAreas>
                            <Legends>
                <asp:Legend Enabled="true" TableStyle="Tall" IsTextAutoFit="False" Name="Default" BackColor="Transparent" Font="Trebuchet MS, 8.25pt, style=Bold">
                </asp:Legend>
            </Legends>
        </asp:Chart>

你能发布图表的设计视图吗

chart4.Series["seriesname"].Url = "somechartorpage.aspx?"+label1.text;              
chart4.Series["seriesname"].Points["name"].Url= "Detailedchart.aspx"; 

我不认为你写的东西本身有什么错。当你说点击偶数[sic]不起作用时,你的意思是该事件没有触发吗?或者响应。重定向没有按计划工作?尝试调试您的应用程序,并在单击处理程序上设置断点,以查看事件过程是否正在执行,并让我知道发生了什么。只有在单击图表区域内的序列/点时,而不是图表上的任何位置,才会触发编辑的代码。您好,谢谢您的代码。。第二行有个问题。。它说名称必须是int。。我也不明白我们为什么要使用它。。??我想你不需要使用第二个,我只是举了一个例子,如果你使用的是积分,那么你可以用它把它传递到另一个页面来执行一些逻辑,如果你发现它有用的话,把它标记为答案欢呼