Open Collective
Open Collective
Back to conversations

No ID or x:Name to reference control

Phillip Frabott

Posted on November 23, 2020

I'm trying to reference some of the controls in the code area but I am not able to find an ID or x:Name parameter anywhere. Do you guys call this parameter by a different name?

Henon

Posted on November 23, 2020

You should be able to use id="blabla" or name="foo" on our components.  If you need a reference to the component you can use @ref. What are you trying to accomplish?   

Phillip Frabott

Posted on November 25, 2020

ID didn't seem to work as I got compile errors. I'll see if @ref works.
I was trying to reference the alert control to change the text depending on the information I wanted to relay to the user. There are 4 different success states each needed a different alert message. I didn't want to have to go and build 4 different versions of the control just to change the text. And no, I really don't want to do a binding for something simple and on the fly.

Henon

Posted on November 25, 2020

the alert might not yet have the @attributes splatting enabled yet. please open an issue on Github at https://github.com/Garderoben/MudBlazor under issues, with a simple showcase of how you want to use the alert. we'll make the changes to make the alert more usable, no problem.
👍️  1

Phillip Frabott

Posted on November 25, 2020

Tracker #158

Conversation followers