Wednesday, 13 January 2016
Select Dropdownlist Text and Value using JavaScript in ASP.Net C#
Here I explain about get DropDownList text and value while changing from it using JavaScript.
ASP.NET Code:
<asp:DropDownList ID="ddlType" runat="server" onchange=GetTeamUsersByTeamID(this.value)>
<asp:DropDownList ID="ddlType" runat="server" onchange=GetTeamUsersByTeamID(this.value)>
<asp:ListItem Text="Select" Value="0"></asp:ListItem>
<asp:ListItem Text="Show" Value="S"></asp:ListItem>
<asp:ListItem Text="Hide" Value="H"></asp:ListItem>
</asp:DropDownList>
JavaScript Code:
function GetTeamUsersByTeamID(selectedvalue) {var value = $("[id*=ddlCallType] option:selected").val();
if (value == "S")
alert($("[id*=ddlCallType] option:selected").text());
else if (value == "I")
alert($("[id*=ddlCallType] option:selected").text());
}
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment