Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

uploaded httppostedfile is null using -'c#,asp.net,asp.net-mvc'


uploaded httppostedfile is null  using -'c#,asp.net,asp.net-mvc'

On the View:

<% =Html.BeginForm("About", "Home", FormMethod.Post, new {enctype="multipart/form-data "})%>
  <input type="file" name="postedFile" />
  <input type="submit" name="upload" value="Upload" />
<% Html.EndForm(); %>


In the Controller, there's something like this:

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult About(HttpPostedFile postedFile)
{
    //but postedFile is null
    View();
}


postedFile is null in About(). How do I upload the file?
    

asked Sep 7, 2015 by rajesh
0 votes
21 views



Related Hot Questions



Government Jobs Opening


...