Search code examples
htmlviewmodel

Remove quotation mark from <th> tag in View Model


This is my case:
<th class="myClass" title="hello" world>myText</th>

And I want it to become:
<th class="myClass" title="hello world">myText</th>

This is how i populated the title:
@{string myTitle = Model.MyTitle;}
<th class="myClass" title=@myTitle>myText</th>

Model.MyTitle = "hello world".

As I see, it separates multiple words into multiple attributes. Why? :
<th class="myClass" title="hello" world="">myText</th>


I used title attribute for Powertip.


Solution

  • Solved the problem doing this:
    <th class="myClass" title="@myTitle">myText</th>