Selva
Selva

Reputation: 53

Need to implement tooltip in Asp.net MVC3-Razor

I need to implement jquery tooltip in Asp.net MVC3-Razor view. Can anybody give some tips & samples to carry out this operation

Thanks, Selva

Upvotes: 4

Views: 13873

Answers (2)

Psyche
Psyche

Reputation: 51

If you just want simple text to be shown in your tooltip, i found this to be the best solution -

:)

If you want to apply for different controls, do something like this -

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

works for everything except EditorFor. Enjoy.

Upvotes: 5

busticated
busticated

Reputation: 2187

Personally, I prefer the tooltip plugins that:

  • Reuse a single container (vs. wrapping target elements in a bunch of curfty markup)
  • Allow for tip content to be declared on the target element itself (via "data-" attributes)
  • Allow full styling via css classes (on / off states, etc controlled by adding css classes as opposed to injecting inline style rules)

There are literally tons of options out there... when I last checked, this one was my personal preference:

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

But there are many more... including one native to jQuery UI coming soon!

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

Upvotes: 1

Related Questions