AjaxControlToolkit有一个HoverMenuExtender控件用于当鼠标滑过一个Web控件时,弹出一个列表,首先观看效果:

这是AjaxControlToolkit控件,当然是在Ajax下应用。在aspx页面中应该要写上:

ScriptManager

 <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

不然在页面run时,会出现如下Error:

Server Error in '/InsusTutorials' Application.

The control with ID 'UpdatePanel1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The control with ID 'UpdatePanel1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: The control with ID 'UpdatePanel1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.]System.Web.UI.UpdatePanel.get_ScriptManager() +205System.Web.UI.UpdatePanel.RegisterPanel() +89System.Web.UI.UpdatePanel.OnInit(EventArgs e) +20System.Web.UI.Control.InitRecursive(Control namingContainer) +391System.Web.UI.Control.InitRecursive(Control namingContainer) +188System.Web.UI.Control.InitRecursive(Control namingContainer) +188System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1579

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.431

接下来,我们在网页上,放置一个web控件,下示例是使用fieldset,它是一个Html标题,把它转为一个Web控件,所以加上run="server"属性。

fieldset

 <fieldset id="fieldsetl" runat="server" style="margin: 10px; padding: 3px; width: 13.2%;"
                align="absmiddle" onmouseover="this.style.backgroundColor='#99ccff'" onmouseout="this.style.backgroundColor='' ">
                HoverMenuExtender
            </fieldset>

如果你为HoverMenuExtender指定一个Html 标签的时,它会Error:

Server Error in '/InsusTutorials' Application.

The TargetControlID of 'HoverMenuExtender1' is not valid. A control with ID 'fieldsetl' could not be found.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The TargetControlID of 'HoverMenuExtender1' is not valid. A control with ID 'fieldsetl' could not be found.

接下来,把HoverMenuExtender控件拉至网页内,两个属性一个要写TargetControlID和PopupControlID,前者是激活菜单的控件ID,此例的TargetControlID是fieldsetl,而后者是Popup菜单控件ID, 此例指向Panel1。

HoverMenuExtender

 <ajaxToolkit:HoverMenuExtender ID="HoverMenuExtender1" runat="server" TargetControlID="fieldsetl"
                PopupControlID="Panel1" PopupPosition="Right" OffsetX="5" OffsetY="3" />

最后,是写Popup菜单Panel控件,从工具栏拉至网页。

Panel1

<asp:Panel ID="Panel1" runat="server" CssClass="HoverMenuStyle">
                Hello Insus.NET!
                <br />
                This is AjaxControlToolkit HoverMenuExtender control demo.
            </asp:Panel>

不要忘记了,还要为这个Panel写上样式:

HoverMenuStyle

.HoverMenuStyle
        {
            background: #fff6bf;           
            text-align: left;
            padding: 5px;
            border: 1px solid #ffd324;
            display: none;
            z-index: 1;
        }

应该不难喔。

AjaxControlToolkit HoverMenuExtender 控件演示相关推荐

  1. ATLAS入门篇之HoverMenuExtender控件编程(2)

    (二)创建过程 启动Visual Studio 2005,选择"文件→新建网站-",然后选择"ASP.NET AJAX-Enabled Web Site"模板( ...

  2. AjaxControlToolkit工具控件之Accordion错误解决方法

    在做AjaxControlToolkit的Demo时,用vs2005新建个ajax网站,将Accordion控件托到页面上,再将AccordPane控件托到<panes></pane ...

  3. DataGridView数据控件演示

    书上的一段话,没有深入介绍呀.这才是我感兴趣的. ...基要以小型网格显示只读值或者使用户能够编辑具有数百万条记录的表,DataGridView控件将提供可以方便地进行编程以及有效地利用内存的解决方案 ...

  4. 自动校验控件演示[含源码]

        在开发网站的过程中,总是在不停的在设置窗口过程中堆放一个又一个的校验控件,虽然 不是很麻烦,但还是有些头上飞苍蝇的感觉,由于最近的项目进行的比较顺利, 同时又有时 间剩余,就想着写一个控件,让 ...

  5. python entry_tkinter常用控件演示(Entry)

    Entry是 tkinter 中比较常用的控件,它通常用来接收字符串的输入,这个控件使得用户可以输入编辑一行文字:如果输入文字过长(超过Entry的可显示宽度),文字便会自动向后滚动,这种情况下没法在 ...

  6. 使用javascript oop开发滑动(slide) 菜单控件

    这里使用原生的javascript,用面向对象的方式创建一个容易维护使用方便的滑动菜单 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Tra ...

  7. DotNetTextBox V3.0 所见即所得编辑器控件 For Asp.Net2.0(ver 3.0.9Beta)

    英文名:DotNetTextBox V3.0 WYSWYG Web Control For Asp.Net2.0 中文名:DotNetTextBox V3.0 所见即所得编辑器控件 For Asp.N ...

  8. 分页控件 实战 Post篇

    2019独角兽企业重金招聘Python工程师标准>>> 前言: 分页,大伙并不陌生 也许你正用着:DataGrid/GridView自带的分页 也许你正用着:网上流传较广的Aspne ...

  9. DotNetTextBoxV3.0在线编辑器控件Ver3.4.1 Open Source开源版(附商业试用版下载)

    英文名:DotNetTextBox V3.0 WYSWYG Web Control For Asp.Net2.0/3.5 Open Source 中文名:DotNetTextBox V3.0 所见即所 ...

最新文章

  1. 如何使用eclipse创建Javaweb项目
  2. python 之 __new__ 方法理解
  3. k近邻算法_K近邻(knn)算法是如何完成分类的?
  4. linux串口编程实例_Linux 网络编程——原始套接字实例:发送 UDP 数据包
  5. 【数值分析】数值分析的微积分学基础
  6. PyTorch 1.0 中文官方教程:训练分类器
  7. EDA实验课课程笔记(四)——TCL脚本语言的学习2
  8. 概率论 —— 分析计算机系统和网络的可靠性和通用性
  9. Machine Learning 务实----Applying deep learning to real-world problems
  10. 请详细描述LVS DR模式的原理
  11. matlab颜色选取与绘制?(附有颜色全表)
  12. 宾得k5ii_K5--K5II---K5IIs,该选哪个?(喜欢宾得机的摄友)各抒己见。
  13. 玩转小米盒子1:选购指南及应用推荐
  14. 随机森林算法(Random Forest)原理分析及Python实现
  15. 异数OS 织梦师-水母(一)--消息队列篇
  16. app上架小米应用商店流程
  17. fastadmin 多表关联查询
  18. 青出于蓝胜于蓝-(树状数组+DFS序)
  19. 有关LaaS、PaaS、SaaS概念认识
  20. 原生js制作动画效果

热门文章

  1. 武汉大学计算机学院 曹老师,关于校园网吧建设的计算机网络综合设计.doc
  2. c语言hellowwo所占字节数,哪个懂C语言?帮忙做~个题,跪求
  3. vue解决线上跨域的问题_vue前后端分离解决跨域问题
  4. python中rim的用法_Python笔记(六)_函数
  5. sqlserver2012不是有效的安装文件夹_SQL Server 2012软件安装说明
  6. Linux初学(CnetOS7 Linux)之切换命令模式和图形模式的方法
  7. Django学习笔记(10)——Book单表的增删改查页面
  8. html概述和基本结构
  9. 洛谷 1658 购物
  10. List-ArrayList 使用