Reputation: 575
I have a bootstrap tooltip on a table, as you can see in the screenshot.
In the view this is the code that I use:
foreach (var tecDoc in vehicles.TecDocs)
{ <a href="#" data-toggle="tooltip" title=@(tecDoc.Text + " " + tecDoc.Value)>Hover over me</a> }
<a href="#" data-toggle="tooltip" title="HoorayHoorayHoorayHooray!">Hover over me</a>
The first tooltip only shows the text: Cod, although it contains the data correctly, because I checked in debug, and it is ok.
I thought that the problem is that the tooltip text is too long, but I put the second tooltip with a longer text, and that is showing ok. Do you have any idea what can cause the problem? Thanks!
Upvotes: 0
Views: 803
Reputation: 462
I believe your issue is in the title section. I think the issue is the fact that it's lacking quotation marks around it.
basically, you need to make sure that
@(tecDoc.Text + " " + tecDoc.Value) = "Some text"
Right click it on Chrome and press "inspect element" to see what that currently looks like.
Also I suggest adding a data placement tag. Just to be sure it will look the same everywhere :)
Would have just commented instead of answering, but SO wont let me.. Good luck! :)
Upvotes: 1