asp.net-based webmenu data manipulation 1

Source: Internet
Author: User
Tags implement

Absrtact: More and more Web pages are used to the menu, generally speaking, the method of menu making more, programming language is basically JavaScript or VBScript two kinds, this kind of menu once make good can not change, revise up more troublesome. This article explains the Webmenu control, at the same time gives the example, the menu and the database combine to realize the dynamic menu.

Objective:

Drop-down menu technology is often used in large web sites (such as Microsoft's Web site) for site navigation, which can effectively shorten the viewer's time to locate specific content. This can be achieved with JavaScript or VBScript, but you need to learn scripting languages and DHTML. Alternatively, you can also use Dreamweaver and CSS to create (multilevel) Pull-down menus.

To analyze the menu display process, you can find the following points:

1 when the mouse moves to the text (or image), menu display;

2 the mouse from the text (or image) to move away (except the position outside the menu), the menu disappears;

3 Mouse moves from text (or image) to menu, menu remains displayed (this is the key); the mouse moves away from the menu and the menu disappears.

4 for the multi-level menu also to maintain a subordinate menu synchronization.

5 changes the appearance (foreground, background, or border) of a menu item when the mouse is moved to it.

These features enable some of the functions of the menu, some menu functions can not be passed or not convenient through the scripting language to operate, for example, how to implement the menu disenable and enable function. And how to implement the menu of "process operation" (that is, no "open file", you can not "edit" function), these methods can not be implemented through the script, while scripting words embedded in the HTML language, complex structure, writing trouble, high technical requirements, can not quickly grasp, Now there are also some writing web menu tools, through software operations, generate scripts, and then copy the script to the Web page, although this can also implement the Web menu, but also do not realize the part of the function described above.

First part: Web Munu control

A very useful control was searched on the web, Webmenu for ASP. NET (http://www.coalesys.com), in addition to the ability to generate scripting language, the control can also support database operations, by setting the value of some properties in the database, you can implement menu-related functions. And the control generated by the script can be oriented to the national kernel browser, so that the true compatibility, use up no worries.

To register before use. After registration, you can embed the registration code into the asp.net background, so that when you distribute the deployment, there is no error. The license key for Web menu is a string with the format: "Username: Company Name: Serial number", use the following:

Webmenu.userdata = "John doe:acme corp:1234567890";

If you do not have a company name, use the following methods:
Webmenu.userdata = "John doe::1234567890";

The way to use this control specifically is as follows:

1: Copy the DLL to the solution's Bin directory.

2: Register on your page. Statement is:

<%@ Register tagprefix= "cswm" namespace= "Coalesys.webmenu" assembly= "Coalesys.webmenu"%>

3: Place the Web Menu object on the page.

<cswm:webmenu
ID = "Quickmenu"
Clearpixelimage = "/images/clearpixel.gif"
Popupicon = "/images/popup.gif"
Selectedpopupicon = "/images/selectedpopup.gif"
runat = "server" >
</cswm:WebMenu>

4: Add menu groups and menu items.

<cswm:webmenu
ID = "Quickmenu"
Clearpixelimage = "/images/clearpixel.gif"
Popupicon = "/images/popup.gif"
Selectedpopupicon = "/images/selectedpopup.gif"
runat = "server" >

<cswm:group
Caption = "Home"
runat= "Server" >

<cswm:item
Caption = "News"
URL = "News.aspx"
runat = "server"/>

</cswm:Group>

</cswm:WebMenu>

5: Add nested menu groups and menu items.

<cswm:webmenu
ID = "Quickmenu"
Clearpixelimage = "/images/clearpixel.gif"
Popupicon = "/images/popup.gif"
Selectedpopupicon = "/images/selectedpopup.gif"
runat = "server" >

<cswm:group
Caption = "Home"
runat= "Server" >

<cswm:item
Caption = "News"
URL = "News.aspx"
runat = "server"/>

<cswm:item
Caption = "about"
URL = "About.aspx"
runat = "server"/>

<cswm:item
Caption = "Products"
runat = "server" >

<cswm:group runat= "Server" >

<cswm:item
Caption = "Super Widget"
URL = "Superwidget.aspx"
runat = "server"/>

<cswm:item
Caption = "Super Widget Pro"
URL = "Superwidgetpro.aspx"
runat = "server"/>

</cswm:Group>

</cswm:Item>

</cswm:Group>

</cswm:WebMenu>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.