ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Set DropDownList selected value using jQuery in ASP.Net MVC<p>Hi&nbsp;kavithav,</p> <p>Check this example. Now please take its reference and correct your code.</p> <p><strong><span style="text-decoration: underline;">Controller</span></strong>&nbsp;</p> <pre class="brush: csharp">public class HomeController : Controller { // GET: /Home/ public ActionResult Index() { return View(); } public JsonResult PopulateDropDownList() { // Bind record from database. List&lt;model&gt; items = new List&lt;model&gt;(); items.Add(new model { Id = 2 }); return Json(items, JsonRequestBehavior.AllowGet); } public class model { public Int32? Id { get; set; } } }</pre> <p><strong><span style="text-decoration: underline;">View</span></strong></p> <pre class="brush: html">&lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head&gt; &lt;title&gt;Index&lt;/title&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; $(function () { $.ajax({ type: &#34;GET&#34;, url: &#34;Home/PopulateDropDownList&#34;, dataType: &#34;json&#34;, async: true, cache: false, traditional: true, contentType: &#34;application/json; charset=utf-8&#34;, success: function (data) { if (data.length &gt; 0) { $.each($(&#34;#ddlValue&#34;).find(&#39;option&#39;), function () { if ($(this).val() == data[0].Id) { $(this).attr(&#39;selected&#39;, &#39;selected&#39;); return false; } }); } } }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;select id=&#34;ddlValue&#34; style=&#34;height: 25px; width: 15%;&#34;&gt; &lt;option value=&#34;0&#34;&gt;All&lt;/option&gt; &lt;option value=&#34;2&#34;&gt;Value1&lt;/option&gt; &lt;option value=&#34;1&#34;&gt;Value2&lt;/option&gt; &lt;option value=&#34;3&#34;&gt;Value3&lt;/option&gt; &lt;/select&gt; &lt;/body&gt; &lt;/html&gt;</pre> <p><strong>Screenshot</strong></p> <p><strong><img src="https://i.imgur.com/rYv7AOd.jpg" alt="" width="224" height="131" /></strong></p>https://www.aspforums.net:443/Threads/150004/Set-DropDownList-selected-value-using-jQuery-in-ASPNet-MVC/https://www.aspforums.net:443/Threads/150004/Set-DropDownList-selected-value-using-jQuery-in-ASPNet-MVC/Thu, 01 Aug 2019 05:01:15 GMT