aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Strange order of markup causing build error

Open davidbmasterson opened this issue 8 years ago • 2 comments

I was playing with showing or hiding an input by switching from style="display:none" and style="display:" the code I was using was

<input @bind(todo.Item) style="display:@ShowOnEditing(todo.ID);" />

This crashed with an error CS1503: Argument 2: cannot convert from 'string' to 'Microsoft.AspNetCore.Blazor.RenderTree.RenderTreeFrame'

if I change the order of the style and the bind

<input style="display:@ShowOnEditing(todo.ID);" @bind(todo.Item) />

it works fine

The code is at https://github.com/davidbmasterson/ASPBlazorCrudModified

the commented code at line 54 of ToDo.cshtml is what causes the error.

I appreciate that this might be completely redundant now with the changes being made to the bind attribute. but it was strange enough that I thought I should share it just in case it is not going to be fixed by the coming changes.

davidbmasterson avatar Apr 06 '18 05:04 davidbmasterson

I think this is a duplicate or similar to #496/#386

chrissainty avatar Apr 06 '18 07:04 chrissainty

yeah looks like it is the same as aspnet/Blazor#386 must have missed that. will close

davidbmasterson avatar Apr 06 '18 08:04 davidbmasterson