Select Dropdownlist value in Asp.Net MVC

Select Dropdownlist value in Asp.Net MVC

In this tutorial we have learn Select Dropdownlist value in Asp.Net MVC,for binding dropdown list learn previous tutorial Dynamic DropDownList Binding in ASP.NET MVC With Database 

So let’s start to leran Select Dropdownlist value in Asp.Net MVC Step by step

Step 1: Create an MVC Application

Step 2: Now we have bind these viewbag data to DropDownList using below mentioned code in particular page using razor-view syntax.

<div class=”editor-field”>
@Html.DropDownList( “Designation”, ViewBag.Designation as SelectList, “-Select -“, new { style = “width:70px;height:25px”, @id = “Designation” } )
</div>

Step 3 : Now select dropdown list value using jquery by using mentioned code

function InsertData()
{
var Dg = $(‘#Designation :selected‘).text();
}

Now, you have try this code and run your web application, and have any query regarding Select Dropdownlist value in Asp.Net MVC, then feel free to comment on comment section

Select Dropdownlist value in Asp.Net MVC

SEE MORE

Leave a Reply

Your email address will not be published. Required fields are marked *