Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want display response value when file is uploaded succesfuly...
my code is ...
  <form class="form1" enctype="multipart/form-data" method="post" action="@Url.Action("Upload")" >
                	<input id="fileToUpload1" name="fileToUpload1" type="file"/>
                    <div style="width:500px;">
                    <div id="Mydiv"></div>
                    <progress id="progressBar" value="0" max="100">  </progress>  
                    
                    </div>
               
				
                 </form>

<script type="text/javascript">
  // File load event
				            xhr.upload.addEventListener("load", loadSuccess, false);

				            function loadSuccess(evt) {
                              //here i want to display response result
				             //  alert("Response");
                                }

controller is...
[HttpPost]
      public ActionResult Upload(object fileToUpload1)
      {

              int sucessid= 101;
              return Json(sucessid, JsonRequestBehavior.AllowGet);
       }

and that succes id i want to display on upload success event of view...Controller return that value but not display in alert of load event handler method...
Posted

1 solution

I am also waiting for the answer of this problem...
 
Share this answer
 
Comments
[no name] 30-Apr-13 21:26pm    
Exactly how is you notifying everyone that you are waiting for an answer to this 2 year old question, a solution to the problem?
Brian A Stephens 1-May-13 9:26am    
I was wondering the same thing. Got my downvote.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900