.NET Framework Bookmark and Share   
 index > Chart Controls for .NET Framework > javascript postback for chart imageclick does not work on IE 7,8. Works on FF and Opera.
 

javascript postback for chart imageclick does not work on IE 7,8. Works on FF and Opera.

Hi,
Great place this forum. Always helped me.
My question: i have chart, with custom legendwith image on it. I added postbackvalue for the click on the image with:

Me.ChartOppLoc2.Legends(0).CustomItems(1).Cells(0).PostBackValue = "LegendClick/0"

and added handler for afunction that will draw some lines on the chart with :

AddHandler Me.ChartOppLoc2.Click, AddressOf ChartOppLoc_Click

However this does not work on IE7/8. Works with FF and Opera. The pointer cursor is there and the link says "javascript:__doPostBack('LegendClick/0',''ChartOppLoc2)" which is also correct.
I debug and it doesn't go to the function at all. This functionality has always worked fine till now. the only difference now is i use some ajax methods from coolite. However this is not directly related to the chart in any way. Really got me confused. Before using ajax methods i tried using this code : coolite.GridPanel.AddScript("javascript") which also caused the issue. I need to note that postback works without ajax method. The ajax method is used for showing/hiding the coolite panel.


some HTML:

<ext:Tab ID="TabOppLoc2" Enabled="false" runat="server" Title="Opportunity Locator 2" >

<Body><br />

<asp:Chart ID="ChartOppLoc2" runat="server" >
...




Some aspx.vb code

<AjaxMethod()> _

Public Sub swapCodes()

'enable/disable opp locator tab 2

If radioData17.Checked = True Then

TabOppLoc2.Enabled =

False

Exit Sub

Else

TabOppLoc2.Enabled =

True

Exit Sub

End If

...

' Add custom legend item with image England

Dim legendItem = New LegendItem()

legendItem.BackImageTransparentColor = Color.White

legendItem.Cells.Add(LegendCellType.Image, "images/radio_button_unchecked.gif", ContentAlignment.MiddleCenter)

legendItem.Cells.Add(LegendCellType.Text, "Mean England", ContentAlignment.MiddleLeft)

ChartOppLoc2.Legends("LegendQOF3").CustomItems.Add(legendItem)

ChartOppLoc2.Legends("LegendQOF3").CustomItems(1).Cells(0).ImageTransparentColor = Color.Black

...



Any ideas are greatly appreciated. Thank you

...




  •  
patrahil
Are you getting any javascript errors? If not, you can check if the page gets call backs: set break point on page_load and inspect query parameters.

DelianT

You can use google to search for other answers

Custom Search

More Threads

• Custom IChartStorageHandler implementation fails to load
• asp.net Chart Controls on a user control in MVC
• Financial Formula
• ImageLocation - Networkshare
• How to get/track Browser's refresh button click event?
• Chart.SaveImage throws exception when chart has two scale breaks
• tick marks show through markers
• HOW TO ADD THE RADOR CHART AND HOW TO ENTER THE DATA IN THE RADOR CHART
• Integers grouping
• why Chart control not showing all points labels on x-axis