hi
I used below code to change dropdownlist color and style:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="Script/jquery.selectric.min.js"></script>
<link href="css/selectric.css" rel="stylesheet" />
<script>
$(function () {
$('select').selectric({
maxHeight: 200
});
});
</script>
and html:
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<div id="ddlzoneD">
<asp:DropDownList ID="Ddlzone" runat="server" CssClass="ddlzone" AutoPostBack="true"
OnSelectedIndexChanged="ddlZone_OSIC">
</asp:DropDownList>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPstate" runat="server">
<ContentTemplate>
<div id="ddlCity1D">
<asp:DropDownList ID="DdlCity" runat="server" CssClass="ddlCity1" AutoPostBack="true"
OnSelectedIndexChanged="ddlcity_OSIC">
</asp:DropDownList>
</div>
</ContentTemplate>
</asp:UpdatePanel>
protected void ddlcity_OSIC(object sender, EventArgs e)
{
string code = DdlCity.SelectedItem.Text;
switch (code)
{
case "تهران":
{
Ddlzone.Enabled = true;
Ddlzone.Items.Insert(0, new ListItem("منطقه", "0"));
BindDropDownList(Ddlzone, "SelectZone", "Name", "id");
}
break;
default:
Ddlzone.Enabled = false;
break;
}
}
here when run page it work correctly but here as you see I used updatepanel for dropdownlists when I select Item from DdlCity it will update and it return Dropdownlist Style to asp.net default:
see below image is when run page:
and below image is when I select Item from DdlCity:
what should I do?
Best regards
Neda