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
SEE MORE
- Auto Refresh Partial View in ASP.NET MVC
- What is ASP.NET Core
- Difference between TempData keep() And Peek() in Asp.Net MVC
- Difference between viewbag,viewdata and tempdata in asp.net mvc
- ASP.NET MVC With AngularJS
- Retrieving Data Using Form Collection and Inserting Into ASP.Net MVC
- MVC CRUD Operations Using Entity Framework
- Search Functionality in ASP.NET MVC
- How to create a User Registration page using asp.net mvc
- Store Multiple Checkbox state from cookie using Jquery
- Cascading Dropdownlist using Ajax in Asp.Net Mvc with city state country
- Insert, Update, Delete In GridView Using ASP.Net C#
- Binding Dropdownlist With Database In Asp.Net MVC
- Search and Filter data in Gridview using Asp.net MVC
- Select Insert, Update And Delete With ASP.NET MVC
- Display Data in GridView Using Asp.net MVC
- Validation in ASP.NET MVC Razor view
- CRUD Operation Using 3-Tier Architecture In ASP.NET
- How to get Connection String from Web.Config in Asp.Net C#
- Login page using 3-Tier Architecture in ASP.Net
- Asp.Net Image Upload in 3-Tier Architecture and store in sql database