Click here to Skip to main content
15,896,402 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
<input id="Screens[0].BackgroundImagePath" name="Screens[0].BackgroundImagePath" class="form-control" type="file" />


jquery codeing
C#
<script type="text/javascript">
      // debugger;

       //alert(attFile);
       $(".download").click(function () {
           debugger;

           var attFile = $('#Screens\\[0\\]\\.BackgroundImagePath')[0].files;
           var formData = new FormData();
           formData.append($("#form").serialize(),attFile);
           alert(attFile);
           $.ajax({
               type: "POST",
               url: "/MFinity/Generate",
               //data: JSON.stringify(MFinityAPIController),

               data:(formData),
              //data:$("#form").serialize(),
               success: function (data, status, xhr) {
                   alert("The result is : " + status);
               },
               error: function (xhr) {
                   alert(xhr.responseText);
               }

           });
       });
   </script>


And Create Controller
------------------------
C#
public string Generate(AppviewModel Application)
{
           
}

AppviewModel my model class
public string Imgage{get;set;}
Posted
Updated 15-Jun-15 21:08pm
v2
Comments
Krunal Rohit 16-Jun-15 3:09am    
Can you be more clear ?

-KR

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