Hi All,
How to call BalloonPopupExtender on dropdown SelectedIndexChanged event on code behind
i have a sample code please have a look on that,
<asp:DropDownList runat="server" ID="ddlPollutant" Width="130px" AutoPostBack="true" OnSelectedIndexChanged="ddlPollutant_SelectedIndexChanged">
<asp:ListItem Text="--Select--" Value="-1" Selected="True"></asp:ListItem>
<asp:ListItem Text="H2S" Value="34.08"></asp:ListItem>
<asp:ListItem Text="SO2" Value="64.0628"></asp:ListItem>
<asp:ListItem Text="HCl" Value="36.461"></asp:ListItem>
<asp:ListItem Text="NH3" Value="17.0306"></asp:ListItem>
<asp:ListItem Text="HCN" Value="27.0253"></asp:ListItem>
</asp:DropDownList>
<asp:Panel runat="server" ID="Panel1" Style="display: none">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td nowrap="nowrap">
NaOH at low pH
</td>
</tr>
<tr>
<td nowrap="nowrap">
NaOH at high pH
</td>
</tr>
</table>
</asp:Panel>
protected void ddlPollutant_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlPollutant.SelectedItem.Text == "H2S")
{
BalloonPopupExtender BPE = new BalloonPopupExtender();
BPE.TargetControlID = ddlPollutant.ID;
BPE.BalloonPopupControlID = Panel1.ID;
BPE.Position = BalloonPopupPosition.BottomRight;
BPE.BalloonStyle = BalloonPopupStyle.Rectangle;
BPE.BalloonSize = BalloonPopupSize.Medium;
BPE.UseShadow = true;
BPE.DisplayOnMouseOver = true;
BPE.DisplayOnClick = false;
BPE.DisplayOnFocus = false;
Panel1.Attributes.Add("style", "display:block");
}
if (ddlPollutant.SelectedItem.Text == "SO2")
{
Panel1.Attributes.Add("style", "display:none");
}
if (ddlPollutant.SelectedItem.Text == "HCl")
{
Panel1.Attributes.Add("style", "display:none");
}
if (ddlPollutant.SelectedItem.Text == "NH3")
{
Panel1.Attributes.Add("style", "display:none");
}
if (ddlPollutant.SelectedItem.Text == "HCN")
{
Panel1.Attributes.Add("style", "display:none");
}
}
But it was not working for me .
Please give solution to this.
Thanks in advance,
VenkiDesai.