Reputation: 5880
Why does the following work:
@if(Page.SomeVar == "VALUE"){
@Html.Raw(".classStyle{border:1px solid #000} #idStyle{border:1px solid #000}")
}
Yet this breaks:
@if(Page.SomeVar == "VALUE"){
@Html.Raw("
.classStyle{border:1px solid #000}
#idStyle{border:1px solid #000}
")
}
Upvotes: 2
Views: 1955
Reputation: 139778
This has nothing to do with Razor in C# you need to use @
if you want to have multiple line string literals
@if(Page.SomeVar == "VALUE"){
@Html.Raw(@"
.classStyle{border:1px solid #000}
#idStyle{border:1px solid #000}
")
}
Upvotes: 3