Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 带有列表的表单_C#_Asp.net Mvc_Forms_Http Post - Fatal编程技术网

C# 带有列表的表单

C# 带有列表的表单,c#,asp.net-mvc,forms,http-post,C#,Asp.net Mvc,Forms,Http Post,我一直在为一件在我看来很简单的事情而挣扎。我需要创建一个包含列表列表的表单 这就是我想制作的模型: public OrderViewModel() { DeliveryAddress = new ProjectDeliveryAddressViewModel(); OrderItems = new List<OrderItemView>(); } public int ProjectDeliveryId { get;

我一直在为一件在我看来很简单的事情而挣扎。我需要创建一个包含列表列表的表单

这就是我想制作的模型:

    public OrderViewModel()
    {
        DeliveryAddress = new ProjectDeliveryAddressViewModel();
        OrderItems = new List<OrderItemView>();
    }

    public int ProjectDeliveryId { get; set; }
    public long ProjectId { get; set; }
    [Display(ResourceType = typeof(Res.ViewModels.Common), Name = "CustomerOrderNumber")]
    public string CustomerOrderNumber { get; set; }

    [Display(ResourceType = typeof(Res.ViewModels.Common), Name = "DeliveryDate")]
    public string RequestedDeliveryDate { get; set; }
    public ProjectDeliveryAddressViewModel DeliveryAddress { get; set; }

    public IList<OrderItemView> OrderItems { get; set; } 
}

public class OrderItemView
{
    public OrderItemView()
    {
        Additionalitems = new List<AdditionalItem>();
    }

    public long ProjectItemId { get; set; }
    public string ItemName { get; set; }
    public string ImageData { get; set; }
    public int Quantity { get; set; }
    public decimal Price { get; set; }
    public string AaCompany { get; set; }
    public string SupplierName { get; set; }
    public int SupplierModelId { get; set; }
    public IList<AdditionalItem> Additionalitems { get; set; } 
}

public class AdditionalItem
{
    public string Name { get; set; }
    public string Id { get; set; }
    public bool Value { get; set; }
    public decimal Price { get; set; }
    public int Quantity { get; set; }
}

最简单的方法是什么,以便我以后可以轻松地将表单发布到我的mvc控制器?

您使用哪种表单?WinForms或WPF?html表单。等等等等对不起,我已经尝试了html的一点,他们是痛苦的这类事情。祝你好运!您是否以我可能使用的任何其他方式解决了此类问题?我想您将需要动态生成HTML表。