my model contains
1. Role_Id (primary_kye, autoincrement(1,1))
2. Status (dropdown bar)
3. Role_Description (text box)
Problem is i hv got the value of list taken from other table column, and when i select dropdown list item and enter text box value..and then save....but when i see my database...value in not inserted....

Bikesh SrivastavaRank #108 · 20.3K reputationPosted Jul 25, 2016, 4:18 AM EDT
Manas MohapatraRank #182 · 13.2K reputationPosted Jul 24, 2016, 11:15 PM EDT
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Jul 24, 2016, 11:05 PM EDT
Kunal Gupta147 reputationPosted Jul 24, 2016, 11:19 PM EDT
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using vijay_dotnet.Models;
namespace vijay_dotnet.Controllers
{
public class RoleController : Controller
{
//
// GET: /Role/
public ActionResult Role()
{
FTSdatabaseEntities d = new FTSdatabaseEntities();
{
ViewBag.Status_Description = new SelectList(d.Status_Master_Table, "StatusId", "Status_Description", "Remarks");
return View();
}
}
}
}
Kunal Gupta147 reputationPosted Jul 24, 2016, 11:20 PM EDT
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace vijay_dotnet.Models
{
public class Role_Master_Model
{
public int Role_Id { get; set; }
public string Role_Description { get; set; }
public string Status { get; set; }
public IEnumerable
//public IEnumerable
}
}
Kunal Gupta147 reputationPosted Jul 24, 2016, 11:21 PM EDT
@{
ViewBag.Title = "Role";
}
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
@Html.DisplayName("Status")
@Html.DropDownList("Status_Description","Select Status")
}
@Html.ActionLink("Back to List", "List")
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
Kunal Gupta147 reputationPosted Jul 24, 2016, 11:54 PM EDT
Manas MohapatraRank #182 · 13.2K reputationPosted Jul 25, 2016, 1:59 AM EDT