Binding to title attribute shows dotvvm binding syntax in tooltip

Hello DotVVM folks!

I am trying to bind to the title property of an element in order to have a tooltip appear. The issue is that the bound value includes DotVVM’s binding syntax as shown in first screenshot.

The tooltip should just be “Up” in this case.

The following screenshot is how I’ve defined the markup and I attempted to use both resource and value bindings. I believe I should use a resource binding as this is a 1 time evaluated i18n string that doesn’t need to change client side.

How do I get only the desired text in the tooltip?

Can you share the SpriteButton control code? It seems the problem will be there.

Ahh, you were correct @tomasherceg. Our SpriteButton is a DotVVM wrapper around a custom WebForms SpriteButton control (our goal is iterative migration of a .net 4.8 project to .net 6+.)

Within the wrapping logic, we are copying attributes of our DotVVM control to the wrapped webforms version. We were not referencing the Value property however and calling .ToString() of the attribute itself.

foreach (var attribute in dotVVMControl.Attributes)
	webFormsControl.Attributes.Add(attribute.Key, attribute.ToString()); // Old
	webFormsControl.Attributes.Add(attribute.Key, attribute.Value.ToString()); // New 

We do this so that we can still rely on original rendering logic mostly untouched that’s been written over the past decade and we’ve interfaced out WebForms dependencies with DotVVM and other .net6+ compatible alternatives.

At any rate, your observation did lead me to finding the issue above and solving my problem. Thanks!

1 Like