如题,我需要的效果是DropdownList的选择项发生改变的时候
增加一个提示框:
选是的时候把选中的项存到数据库中,并刷新页面,
选否的时候只刷新页面,不保存选中的项那个加提示框的效果应该怎么做?

解决方案 »

  1.   

    <asp:DropDownList ID="DropDownList1" onchange="showConfirm();"
            runat="server">
            <asp:ListItem>1</asp:ListItem>
            <asp:ListItem>3</asp:ListItem>
            <asp:ListItem>5</asp:ListItem>
            <asp:ListItem>2</asp:ListItem>
        </asp:DropDownList>function showConfirm()
            {
            confirm("hello world");
            }
      

  2.   

    onchange="change();"<asp:button id="btn" width="0" click="do sth" />function change()
    {
       confirm("是否保存?")?document.getElementById('<%=btn.ClientID%>').click():location.href=location.href;
    }在服务器button btn 的click 事件中 保存数据
      

  3.   

    DropdownList_SelectedIndexChanged()
    事件里面写弹出对话框再做你想做的事