Hello there!
I'm trying to add a button and a dotnetCHARTING:chart to an
asp:repeater. The button's design is to show/hide the chart without
postback. I have found many partial solutions online, but have been
unable to successfully implement anything that acts as intended
without postback. Part of this issue may be how I'm calling the ID of
the object in the initialization.

My Javascript function is as follows:

function toggle(showHideDiv) {
        var ele = document.getElementsById(showHideDiv);
        if(ele.style.display == "none") {
                ele.style.display="block";
        }
        else {
                ele.style.display = "none";
        }
}

and I have it set bound to onclick in the following way:

dotnetCHARTING.Chart SpeedsChart = (dotnetCHARTING.Chart)
e.Item.FindControl("SpeedsChart");
HtmlButton ToggleSpeedBtn = (HtmlButton)e.Item.FindControl
("ToggleSpeedBtn");
ToggleSpeedBtn.Attributes.Add("onclick", "toggle('" + SpeedsChart.ID +
"')");

both the chart and button do exist within the aspx code.

Can anyone help me?

Reply via email to