Dear all,

I try to run my CRUD application for multiple model of Admin information on datatables using JavaScript + EF MVC but not luck to see result successfully.

I am surfing net , read many the forum and also follow step from youtuber but i m
hang for this two function "Add" and "Edit" on few weeks.

Please help me to check and solve which coding part i m wrong and also check jquery plugin too . Thank you for advanced.

What I have tried:

1) "Add New" function cannot back to same screen when pressed "Submit" button.

2) "Edit" function cannot display out information when pressed "Edit"as pencil icon button
 
Below is my Coding:
Model parts: 
  1. public partial class ADMIN  
  2.     {      
  3.         public string ADMIN_ID { get; set; }  
  4.         public string ADMIN_NAME { get; set; }  
  5.         public string ADMIN_PASSWORD { get; set; }  
  6.         public string ADMIN_EMAIL { get; set; }  
  7.         public string ADMIN_STATUS { get; set; }  
  8.         public string ADMIN_COMMENT { get; set; }  
  9.        
  10.         public virtual STATUS STATUS { get; set; }  
  11.     }  
  12.   
  13.   
  14.    public partial class STATUS  
  15.     {  
  16.          
  17.         public string STATUS_ID { get; set; }  
  18.         public string STATUS_DESC { get; set; }  
  19.     }  
view part:
 
  1. @model ABC.Models.ADMIN  
  2.   
  3. @{  
  4.     Layout = null;  
  5. }  
  6.   
  7. @using (Html.BeginForm("StoreOrEdit""Admin", FormMethod.Post, new { onsubmit = "return SubmitForm(this)" }))  
  8. {  
  9.     @*@Html.HiddenFor(model => model.ADMIN_ID)*@  
  10.   
  11.       
  12.         
  13.   
  14.             
  15.   
  16.             
  17.   
  18.             
  19.   
  20.             @Html.ValidationMessageFor(model => model.ADMIN_ID, ""new { @class = "text-danger" })  
  21.         
  22.   
  23.         
  24.   
  25.             
  26.   
  27.             
  28.   
  29.             
  30.   
  31.             @Html.ValidationMessageFor(model => model.ADMIN_NAME, ""new { @class = "text-danger" })  
  32.         
  33.   
  34.         
  35.   
  36.             
  37.   
  38.             
  39.   
  40.             
  41.   
  42.             @Html.ValidationMessageFor(model => model.ADMIN_PASSWORD, ""new { @class = "text-danger" })  
  43.         
  44.   
  45.         
  46.   
  47.             
  48.   
  49.             
  50.   
  51.             
  52.   
  53.             @Html.ValidationMessageFor(model => model.ADMIN_EMAIL, ""new { @class = "text-danger" })  
  54.         
  55.   
  56.         
  57.   
  58.             
  59.   
  60.             
  61.   
  62.             
  63.   
  64.             @Html.ValidationMessageFor(model => model.ADMIN_STATUS, ""new { @class = "text-danger" })  
  65.         
  66.   
  67.         
  68.   
  69.             
  70.   
  71.             
  72.   
  73.             
  74.   
  75.   
  76.         
  77.   
  78.     
  79. @Html.Label("ID"new { @class = "control-label" })@Html.Label(":"new { @class = "control-label" }) @Html.EditorFor(model => model.ADMIN_ID, new { htmlAttributes = new { @class = "form-control", @placeholder = "ID" } })
    @Html.Label("Name"new { @class = "control-label" })@Html.Label(":"new { @class = "control-label" }) @Html.EditorFor(model => model.ADMIN_NAME, new { htmlAttributes = new { @class = "form-control" } })
    @Html.Label("Pasword"new { @class = "control-label" })@Html.Label(":"new { @class = "control-label" }) @Html.EditorFor(model => model.ADMIN_PASSWORD, new { htmlAttributes = new { @class = "form-control" } })
    @Html.Label("Email"new { @class = "control-label" })@Html.Label(":"new { @class = "control-label" }) @Html.EditorFor(model => model.ADMIN_EMAIL, new { htmlAttributes = new { @class = "form-control", @placeholder = "Email", @style = "width:580px;" } })
    @Html.Label("Status"new { @class = "control-label" })@Html.Label(":"new { @class = "control-label" }) @Html.EditorFor(model => model.ADMIN_STATUS, new { htmlAttributes = new { @class = "form-control" } })
    @Html.Label("Comment"new { @class = "control-label" })@Html.Label(":"new { @class = "control-label" }) @Html.EditorFor(model => model.ADMIN_COMMENT, new { htmlAttributes = new { @class = "form-control" } })
      
  80.   
  81.   
  82.     class="form-group">  
  83.   
  84.         "submit" value="Submit" class="btn btn-success" />  
  85.         "reset" value="Reset" class="btn btn-warning" />  
  86.     
  
  • }