Tom Jacky
Tom Jacky

Reputation: 203

why it fail directing to a htm page from cshtml?

I want to direct to a htm page from the cshtml page, the code whitch i wrote in the cshtml page like this:

     <a href = "/content/all/@Model.PageLink" taget = '_blank'> More </a>

where the value of Model.PageLink is "test.htm".

when i click the "More", it allways failed: "http error 404: Bad Request". Who can tell whats wrong about it?

Upvotes: 0

Views: 153

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038710

Try wrapping the call into parenthesis:

<a href="/content/all/@(Model.PageLink)" taget="_blank">More</a>

Upvotes: 1

Related Questions