Search code examples
c#asp.netasp.net-mvcstringrazor

how to add a string after @var in razor engine (ASP MVC)


i have a problem with my code in a ASP MVC app.

I use the razor engine to write a var like:

@var

but now i need to add some text directly after the var:

@varMyText

but this is not working, only with a whitespace:

@var MyText

how to make this without a whitespace?


Solution

  • That'd be

    @(var)MyText
    

    Or

    @(var + "MyText")