Hello,
Im working on html content to disply data in mvc view binding data from model class, my requirement is to set values to input fields to html content from c#.
i want final content should come up with html content and values from model.
EXAMPLE:
- ="fname">First name:
- "text" id="fname" name="fname">
- ="lname">Last name:
- "text" id="lname" name="lname">
- "submit" value="Submit">
This is my html content which is coming from text file. i've data in my model, i.e,
- public class EmployeeModel
- {
- public string fname { get; set; } = "CSharp";
- public string lname { get; set; } = "Corner";
- }
In View :
@Html.Raw(ViewBag.htmlContent)

Sagar MaldePosted Mar 18, 2020, 7:17 AM
Jignesh KumarPosted Mar 17, 2020, 11:03 AM
Vishvjit ShindePosted Mar 17, 2020, 3:29 AM