i am trying to use th开发者_StackOverflow中文版e JQuery tool tip in asp.net application but no where i would find how to call this tool tip if i move my mouse over a label or textbox in asp.net
any solution on this would be great t Thank you
The easiest way to do this is to decorate your ASP.NET controls with CSS classes, say has-tooltip
, then use a jQuery selector on the class to invoke the plugin.
<asp:Label ID="MyLabel" runat="server"
CssClass="has-tooltip"
ToolTip="This provides some help..."
Text="Label" />
<asp:TextBox ID="MyTB" runat="server"
CssClass="has-tooltip"
ToolTip="Enter your text here." />
Then in your scripts -- either injected or in mark up.
<script type="text/javascript">
$(function() {
$('.has-tooltip').tooltip(); // invoke plugin on all elements with class
});
</script>
ASP.NET textboxes are just simple inputs that just have "fancy" ids.
Rick Strahl posted about it on his blog .
精彩评论