We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

data("ejDropDownList") is undefined.

Thread ID:





117517 Nov 2,2014 05:41 PM UTC Nov 3,2014 10:38 AM UTC ASP.NET MVC 1
Tags: DropDownList
Asked On November 2, 2014 05:41 PM UTC

I've created a simple dropdown list as such:

@Html.EJ().DropDownList("ddlLoginName").WatermarkText("Select Login Name").DropDownListFields(Sub(f) f.Text("LoginName").Value("Id")).Width("15em").Datasource(CType(ViewBag.listOfLogin,IEnumerable(Of Login)))

And tried to use the javascript to get its selected value:


The result is always empty/undefined.

It seems like data("ejDropDownList") works only in certain scenario but it wasn't documented.

Saranya Sivakumar [Syncfusion]
Replied On November 3, 2014 10:38 AM UTC

Hi CS,

Thanks for using Syncfusion products.

We would like to let you know that, in Dropdownlist control we are having a method called “getSelectedValue” which is used to get the selected item value in the Dropdownlist. It returns null or undefined if we didn’t specify the value field in the Datasource. If we specify the value field then it will return the value of the selected item. We are having another method called “getValue” which is used to get the text of the selected item in the Dropdownlist. So include the following code snippet in the click event of the Button.


function click()


        var obj = $('#selectCar').data('ejDropDownList');

        var a = obj.getValue();




For your convenience we have prepared the sample based on your requirement, please find the sample from the following location.

Sample Location: Sample

You can also refer the following class reference link for JavaScript. Since, our ASP.NET MVC components are created as wrapper for the JavaScript components the properties, methods and events will be same for MVC components.


Please let us know if you have further concern.




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon