Hi, Thanks for this tutorial. Hope you could solve my doubt. I am referring to following line from this link
http://www.aspsnippets.com/Articles/AJAX-Cascading-DropDownList-using-jQuery-in-ASP.Net.aspx
data 'continentId ' 'ddlContinents.ClientID'.val ''
in your code. i tried using this code and facing a tiny problem. In above mentioned code 'ddlContinents.ClientID'.val stores integer value in contentId for obvious reasons but the requirement of my code is different. i want to pass text which is selected instead of id no. for example if mumbai is listed as second option and i select mumbai it should store mumbai in contentId instead of 2 i.e. integer value. Any Help will be appreciated.
Thanks :)
OK, if you need the text part, just change
$("#<%=ddlContinents.ClientID%>").val()
to
$("#<%=ddlContinents.ClientID%> option:selected").html()
There is a mistake, i.e. quotes (") are missing which are present when you pass General value
data: '{continentId: "' + $('#<%=ddlContinents.ClientID%> option:selected').html() + '"}'
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.