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 SrivastavaPosted Jul 25, 2016, 8:18 AM
Manas MohapatraPosted Jul 25, 2016, 5:59 AM
Kunal GuptaPosted Jul 25, 2016, 3:54 AM
Kunal GuptaPosted Jul 25, 2016, 3:21 AM
@{
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 GuptaPosted Jul 25, 2016, 3:20 AM
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 GuptaPosted Jul 25, 2016, 3:19 AM
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();
}
}
}
}
Manas MohapatraPosted Jul 25, 2016, 3:15 AM
Bikesh SrivastavaPosted Jul 25, 2016, 3:05 AM