Need to implement tooltip in Asp.net MVC3-Razor

I need to implement jquery hint in Asp.net MVC3-Razor view. Can someone give some tips and samples for performing this operation.

Thanks, Selva

+4
source share
4 answers

If you just want plain text to appear in your popup menu, I found this the best solution -

:)

If you want to apply various controls do something like this -

@Html.TextBoxFor(model=>model.FieldName, new {title="Your Tooltip text goes here"}) 

works for everything except the editor. Enjoy it.

+5
source

Personally, I prefer tooltip plugins that:

  • Reuse of one container (compared to wrapping target elements in a bunch of somersaults)
  • Allow declaring the contents of the tip directly on the target element itself (via the "data-" attributes)
  • Allow full style using css classes (on / off states, etc., controlled by adding css classes, as opposed to entering inline style rules)

There are literally a lot of options ... when I last checked, this was my personal preference:

http://code.drewwilson.com/entry/tiptip-jquery-plugin

But there are many more ... including one native in jQuery UI, which will be available soon!

http://blog.jqueryui.com/2010/05/jquery-ui-19m1-tooltip/

+1
source

There is a plugin here that can help.

0
source

Update: Links are no longer active. It was 6 years ago.

Here, open the source code from this link and copy it. His best look is there right now imo.

jQuery Tools dynamic tooltip

Comes with dynamic positioning, slip and damping effect. Now you are unlikely to want to comment on "I need to implement it in a razor." Well, my answer is the same. Keep in mind that if your triggers have relative positions, you need to use this source: jQTools relative position

-1
source

All Articles