1

I have HTML Pages in my ASP.net MVC project. How can i render these pages with dynamic values.

Index.html

< input type="text" value=<%=Dynamic Value Here%> />

1 Answer 1

2

You can't since HTML files will not be parsed by the ASP.NET MVC view engine and it won't understand the server side syntax you will need to insert dynamic values. In order to do this you will need to translate your HTML files into aspx files to use the webforms view engine syntax of <%: %> or cshtml files to use the razor syntax of @. Now you will be able to insert dynamic values since the view engine will insert those values into the HTML that is returned to the browser to be rendered.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.