Last post Jun 29, 2020 04:05 PM by BigMeat
Jun 27, 2020 08:21 PM|BigMeat|LINK
I am moving from Web Form to Blazor, i used a lot of Web User Controls in Web Forms.... I would encapsulate my logic in web user
controls and then set various parameters on that user control. I see that Blazor Components work in a similar way which is great. I have created various Blazor Components, but if a certain condition is set which could be set by one of the parameters I dont
want it to render the Blazor Component. In web forms I would use Me.Visible = False . This would prevent the control from render to the page. Does Blazor have anything similar?
Many thanks in advance
Jun 29, 2020 07:53 AM|Mikesdotnetting|LINK
The most obvious way is:
Jun 29, 2020 08:39 AM|BigMeat|LINK
Thanks for the response. I was tring to avoid that approach as I wanted to put the logic in the component. As I could end with lots of external if statements which would generate a lot of code.
Is there any other way?
Many thanks for all your support
Jun 29, 2020 03:57 PM|bruce (sqlwork.com)|LINK
just add a property to the component that you can set, and put the if inside.
Jun 29, 2020 04:05 PM|BigMeat|LINK
Bruce, thanks ever so much.... why didnt I think of that!
Such a simple but effective approach