Home > Enterprise >  How set static string value for CascadingValue in Blazor
How set static string value for CascadingValue in Blazor

Time:12-25

like as microsoft document you set static string for value in CascadingValue

Blazor learning path

But I couldn't do this, and in Visual Studio 2022 and .NET6, I have a syntax error.

Screen from vs 2022

CodePudding user response:

Thats because razor syntax is searching a variable called Throwback Thursday.

Try using

 <CascadingValue Name="DealName" Value=@("Throwback Thursday")>
</CascadingValue>

This markup will take string value

  • Related