Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I have a requirement in MVC4 with razor to send mail to a person.I have added view with tosend,mesage,subject and file with two button add file and send.as;
C#
<pre lang="c#"><form >
<table>
<tr>
<td>
@html.Textboxfor(m=m.Files)
</td>
</tr>
<tr>
 <td>
    <input type="submit" name="Add File">
</td>
</tr>
</table>


I have also made model mailmodel as

C#
public string tosend
{get;set;}

public string Subject
{
get;
set;
}
public string files
{
get;set;
}

I have save all the entry to database but how can i dynamically add more control for files when Add file is clicked and option to browse for file.I am new to it pleasae help 
Posted
Comments
Sergey Alexandrovich Kryukov 20-Nov-13 12:13pm    
And where is your question?
—SA
aatish442000 20-Nov-13 12:18pm    
How to add Control for files at runtime when Add File Button is clicked
Sergey Alexandrovich Kryukov 20-Nov-13 12:21pm    
What is the "Control for files"? What control?
—SA
aatish442000 21-Nov-13 0:55am    
<input type="file" name="Files" id="Files" />
[no name] 13-Mar-14 1:18am    
You can use Jquery plugins for the Upload of files. That might be helpful and please specify what controls do you want for your file? :)

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