<asp:dropdownlist autopostback="False" id="DropDownList1" runat="server" width="235px">
<asp:listitem>1</asp:listitem>
<asp:listitem>2</asp:listitem>
<asp:listitem>3</asp:listitem>
<asp:listitem>4</asp:listitem>
</asp:dropdownlist>
protected void Page_Load(object sender, EventArgs e)
{
DropDownList1.Attributes.Add("onchange", "change();");
}
<script type="text/javascript">
function change()
{
var dd=document.getElementById ('<%=DropDownList1.ClientID %>');
var value=dd.options[dd.selectedIndex].value;
if(value!="2") // 2 numaralı elemanı devre dışı bırakmak isterseniz
{
setTimeout("__doPostBack('DropDownList1','')", 0);
}
}
</script>
Hiç yorum yok:
Yorum Gönder