【发布时间】:2011-04-27 14:02:58
【问题描述】:
我有一个图表控件。
现在我想要的功能是,如果用户点击图表,它会将它带到一个新页面,我需要向该页面发送一个值。
我试过了,但点击甚至不起作用..
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>
【问题讨论】:
-
我认为您所写的内容本身没有任何问题。当您说“点击甚至 [原文如此] 不起作用”时,您的意思是事件没有触发吗?或者 Response.Redirects 没有按您的计划工作?尝试调试您的应用程序并在单击处理程序上设置断点以查看事件过程是否正在执行,并告诉我会发生什么。
标签: c# asp.net response mschart