我有一個圖表控件。MS Chart的Response.redirect
現在我想要的功能是,如果用戶點擊圖表,它需要它到一個新的頁面,我需要發送一個值到該頁面。
我試過,但點擊甚至不工作..
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");
}
}
我知道我們可以把一個URL的HTML,但後來我不能把一個條件是....?
任何幫助將不勝感激。
感謝
<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沒有按照你的計劃工作?嘗試調試您的應用程序,並在點擊處理程序上設置斷點以查看事件過程是否正在執行,並讓我知道發生了什麼。 – pseudocoder 2011-04-27 14:55:36