开发者

how to use tooltip ui of jquery in asp.net

开发者 https://www.devze.com 2022-12-10 19:01 出处:网络
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

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 .

0

精彩评论

暂无评论...
验证码 换一张
取 消