2

I want to parse razor view file in c# . I have also used Html Agility Pack to parse razor view file but it failed to save correct file contents.

Basically i want to change some html elements inner html by server side using c#

<div id="content1">
<p>this contents i want to change </p>
<span>contes</span>
</div>

i want to change content1 inner html by c# like this

<div id="content1">
    <span>@Function.gethtml()</span>
    </div>

I have used html agility pack to change inner html contents but it is not parsing razor syntax function like

@Url.Content("abc.css") and other function

For more information

I have created a project in asp.net mvc3 for shoes and garments shops.Now i want to change css and html dynamically.i want to extract inner html from any html template file where element id will be "content1" and place this inner html in cshtml file where element id is "content1

Simply i want razor file parser that can parse both html and razor syntax like html parser

Is there any way to parse razor view file and it html elements. Any Other solution

1 Answer 1

-1

You want to access / modify razor content using server side content.

But MVC is a different way of building websites/applications to webforms.

There are now server side controls or webcontrols. You can use JQuery to do same.

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

1 Comment

I think you cant get my question simply i want razor file parser that can parse both html and razor syntax like html parser

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.