<text>@this.Html.Raw("</div><div class=\"newDiv\">").ToString()</text>
I’m trying to output </div><div class="newDiv"> as-is in the view, but, it’s encoding it for me so that I can see the <‘s and the >’s. Any other way of doing this? Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s the
ToString()causing the problem.Html.Rawreturns a specialHtmlStringtelling Razor it doesn’t need to be encoded, but then you’re turning it straight back in to a regular string which does get encoded. Just use: