How do get a webdialogwindow to open by selecting a specific item in an asp dropdownlist? Also, is it possible to do this without setting the dropdownlist to autopostback?
Any help is much appreciated.
Thanks Victor that helped a lot.
Hi,
There are set_windowState(state), show() and hide() member methods of dialog on client. You may use them on any event on client. Below example uses drop-down list action to show hide dialogs.
<script type="text/javascript"> function selectOnChange(select) { var i = select.selectedIndex; var dialog = null; if(i == 0) return; if(i == 1 || i == 3) dialog = $find('<%=WebDialogWindow1.ClientID%>'); else dialog = $find('<%=WebDialogWindow2.ClientID%>'); if(!dialog) return; if(i == 1 || i == 2) { //dialog.set_windowState($IG.DialogWindowState.Normal); dialog.show(); } if(i == 3 || i == 4) { //dialog.set_windowState($IG.DialogWindowState.Hidden); dialog.hide(); } }</script>
<select onchange="selectOnChange(this)"> <option>Select action</option> <option>Show Dialog1</option> <option>Show Dialog2</option> <option>Hide Dialog1</option> <option>Hide Dialog2</option></select>
<ig:WebDialogWindow ID="WebDialogWindow1" runat="server" Width="300px" Height="300px" WindowState="Hidden"></ig:WebDialogWindow><ig:WebDialogWindow ID="WebDialogWindow2" runat="server" Width="100px" Height="100px" WindowState="Hidden"></ig:WebDialogWindow>