this is probably a pretty basic thing for you guys, but I still can't figure it out. Let's say I have a View:
myView.cshtml
<div>
<p>Some content here</p>
@MyHTMLVariable //Calls updateHTML -> MyHTMLVariable = s
<p>Some more content over here</p>
</div>
myController.cs
public string updateHTML()
{
s = "I'm a string"; //Changes dynamically, handled by different stuff outside
//Any string to html-conversion needen?
return s;
}
How can I "update" the variable in the view / how do I have to initialize it?
Cheers,
DDerTyp
@{ var MyHTMLVar = "" }in this way