c# - HttpPostedFileBase always null when using a custom Html Helper -
I have created an HTML Assistant for the file (for file and file):
Public Static IHtmlString File (This HtmlHelper HTML, String Text, String Name, IDictionary & lt; String, Object & gt; Attributes) {// Code Snap TagBolder input = New Tag Creator ("Input"); Input. Merge author ("type", "file"); Input.MergeAttribute ("name", name, true); Input.GenerateId (name); Tmedell, expression (tmp), url string text), text, tap); } Everything is not fine unless I have the following model:
public class AdvertViewNewModel: ViewModel {public AdvertModel Advert {get; Set; } Public Class AdModel {Public HTTP Postfilebase Image {Receive; Set; } The name of the public string {get; Set; }}} The problem is that in this case, ASP provides the .NET input as follows:
And my HTML Helper provides it in this form:
UPDATE
Code for my file:
public static IHtml string file
change
metadata. Display name Metadata Property name ?? Field To
metadata.PropertyName I think it's picking DisplayName instead of PropertyName
Comments
Post a Comment