title: How to display id from model on a admission form success page in ASP.NET MVC?
body: <p>I have made a admission form so after on submitting the form it redirects to another page called &quot;Success&quot; there I want to display the student id or the primary id for each admission form is submitted which is generated in the model my codes are below:</p>
  <p><strong>Model</strong>:</p>
  <pre><code> public class AdmissionModel
     {
      [Key]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public int Std_id { get; set; }  &lt;-- **THIS I want to show in success page** --&gt;
  
      [Required]
      [StringLength(50)]
      public string std_name { get; set; }
      [Required]
      [StringLength(50)]
      public string std_father { get; set; }
      [Required]
      [StringLength(50)]
      public string std_mother { get; set; }
      [Required]
      [DataType(DataType.Date)]
      public string DOB { get; set; }
  
      public string std_gender { get; set; }
      [Required]
      [StringLength(200)]
      public string R_address { get; set; }
      [Required]
      [StringLength(200)]
      public string P_address { get; set; }
    
      public string adm_for { get; set; }
      [Required]
      public string university { get; set; }
      [Required]
      public string E_no { get; set; }
      [Required]
      public string Center { get; set; }
      [Required]
      public string City { get; set; }
   
      public string Field { get; set; }
      [Required]
      public string Marks_secured { get; set; }
      [Required]
      public string out_of { get; set; }
      [Required]
      public string Class_obtained { get; set; }
      [Required]
      public string Sports_details { get; set; }
  
      public string adm_status { get; set; }
  
  }
  </code></pre>
  <p><strong>Controller:</strong></p>
  <pre><code> public class AdmissionController : Controller
     {
      contextclass db = new contextclass();        
      public ActionResult Admission()
      {
          return View();
      }
      
      [HttpPost]
      public ActionResult Admission(AdmissionModel adm)
      {
          AdmissionModel a = new AdmissionModel();
          a.std_name = adm.std_name;
          a.std_father = adm.std_father;
          a.std_mother = adm.std_mother;
          a.DOB = adm.DOB;
          a.std_gender = adm.std_gender;
          a.R_address = adm.R_address;
          a.P_address = adm.P_address;
          a.adm_for = adm.adm_for;
          a.university = adm.university;
          a.E_no = adm.E_no;
          a.Center = adm.Center;
          a.City = adm.City;
          a.Field = adm.Field;
          a.Marks_secured = adm.Marks_secured;
          a.out_of = adm.out_of;
          a.Class_obtained = adm.Class_obtained;
          a.Sports_details = adm.Sports_details;
          db.a_model.Add(a);
          db.SaveChanges();
          
          return RedirectToAction(&quot;Success&quot;, &quot;Admission&quot;);
      }
  
      public ActionResult Success()
      {
      
          return View();
      }
  </code></pre>
  <p><strong>View:</strong></p>
  <pre><code>   @model IEnumerable&lt;ITM_ColLege.Models.AdmissionModel&gt;
  
      @{
         ViewBag.Title = &quot;Success&quot;;
         Layout = &quot;~/Views/Shared/_Layout.cshtml&quot;;
        }
  
       &lt;h2&gt;Admission form successfully submitted&lt;/h2&gt;
       &lt;h1&gt;Please wait for your admission approval check your status from the menu your admission code 
         is  -show id here-
          
  </code></pre>
     
  <p>so I want to display specific id only for one who submits the admission form only.</p>