Hi all,
We are using YUI library in our asp.net project. I have a asp.net autopostback dropdown list which is converted to YUI dropdownlist as the code shown below. Now when user select some value from the dropdownlist the page posts back and the SelectedGroupChanged event fires but before that the confirm dialog box is not appearing. What I could be doing wrong here?
Code:
<asp:Button id="Groups" Enabled="false" runat="server" />
<asp:DropDownList ID="groupsDropDownList" runat="server" AutoPostBack="true" OnSelectedIndexChanged="SelectedGroupChanged" />
<script language="javascript" type="text/javascript">
var YUIGroupsDrpDown;
<%if (Groups.Visible)
{ %>
YUIGroupsDrpDown = new YAHOO.widget.Button("<%=Groups.ClientID %>",{type:"menu", menu: "<%=groupsDropDownList.ClientID %>"});
YUIGroupsDrpDown.set("label", "<%=groupsDropDownList.SelectedItem.Text%>" );
YUIGroupsDrpDown.getMenu().subscribe("click",onGroupsChange);
YUIGroupsDrpDown.on("click", {fn: TakeActions, obj: 'M'});
<%} %>
function onGroupsChange()
{
YUIGroupsDrpDown.set("label", YUIGroupsDrpDown.getMenu().activeItem.srcElement.text );
}
function TakeActions(event, action)
{
var message = 'some message'
if (window.confirm(strMsg) != 1)
return false;
else
return true;
}