mardi 29 décembre 2015

Getting `null` Value In Action

Salaamun Alekum

I Am Getting null Value In Action

HR_TP_Supplier null Assignment1MedicineMasterPharmacy.Models.HR_TP_Supplier

Here Is CSHTML Code

<div class="form-group">
            @Html.LabelFor(model => model.HR_TP_Supplier, "Supplier", htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">

                @Html.ListBox("HR_TP_Supplier", null, htmlAttributes: new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.HR_TP_Supplier, "", new { @class = "text-danger" })
            </div>
        </div>

Here Is C# Action Code

public ActionResult Create([Bind(Include = "MedicineID,Med_Name,Med_code,Generic_Name,Trade_Price,Retail_Price,Accounting_Unit,Nature,THERAPEUTIC_Group,Dosage,Description,Active,Enteredby,Enteredon,ClientID,HR_TP_Supplier")] PH_tmedicine_masterSubmit pH_tmedicine_master)
        {

This Is Entity Class

namespace Assignment1MedicineMasterPharmacy.Models
{
    using System;
    using System.Collections.Generic;

    public partial class PH_tmedicine_masterSubmit
    {
        public int MedicineID { get; set; }
        public string Med_Name { get; set; }
        public string Med_code { get; set; }
        public Nullable<int> Generic_Name { get; set; }
        public Nullable<int> Trade_Price { get; set; }
        public Nullable<int> Retail_Price { get; set; }
        public Nullable<int> Accounting_Unit { get; set; }
        public Nullable<int> Nature { get; set; }
        public Nullable<int> THERAPEUTIC_Group { get; set; }
        public string Dosage { get; set; }
        public string Description { get; set; }
        public string Active { get; set; }
        public string Enteredby { get; set; }
        public Nullable<System.DateTime> Enteredon { get; set; }
        public Nullable<int> ClientID { get; set; }
        public virtual HR_TP_Supplier HR_TP_Supplier { get; set; }
    }
}

Thank You

Aucun commentaire:

Enregistrer un commentaire