Data operation based on ASP.NET WebMenu (1)

zhaozj2021-02-16  53

Summary: More and more web pages are used in the menu. Generally, the menu production is more, the programming language is basically two kinds of JavaScript or VBScript. Once the menu cannot be changed, it cannot be changed, modify comparison trouble. This article explains the WebMenu control, and gives an instance, the menu and database combine, and realize the dynamic menu.

Preface:

The drop-down menu technology is often used in a large website (such as the Microsoft website) to navigate, which can effectively reduce the time of the browser to a particular content. This effect can be implemented with JavaScript or VBScript, but you need to learn scripting languages ​​and DHTML. Alternatively, Dreamweaver and CSS can also produce (multi-level) drop-down menu.

Analyze the display process of the menu, you can find the following points:

1 When the mouse moves to the text (or image), the menu is displayed;

2 Mouse removed from text (or images) (in the place outside the menu), the menu disappears;

3 Mouse moves from text (or images) to the menu, the menu keeps the display (this is the key); the mouse removes from the menu and the menu disappears.

4 For multi-level menus, you must maintain the synchronization of the upper and lower menus.

5 When the mouse moves to the menu item, the appearance of the menu item (prospect, background or border) changes.

These features implement some of the menu, some menu features cannot be operated or inconvenient to operate through scripting languages, for example, how to implement the disenable and enable features of the menu. How to implement the "process operation" of the menu (that is, if you click "Open File", you can't make "edit" function), these methods are unable to implement the script, and the script statement is embedded in the HTML language, the structure is complex, Writing trouble, technical requirements, can not be quickly grasped, now there are some tools for writing web menus, generating scripts through software, generating scripts, then copy scripts to web pages, although web page menus can be implemented, but can not implement the above Some features are said.

Part 1: Web Munu Control

Searched online, WebMenu for asp.net (http://www.coalentsys.com), this control is in addition to the functionality of generating scripting languages, it can also support database operations through the database. Set the values ​​for some properties to implement the features of the menu. Moreover, the script generated by the control can face a true compatibility for the browser of the domestic kernel, and use it without worries.

To register before use. After registration, you can embed the registration code into the background of ASP.NET to make mistakes when you distribute deployments. Web Menu's license key is a string, format: "Username: Company Name: Serial Number" Specific use:

WebMenu.userdata = "John Doe: ACME CORP: 1234567890";

// If there is no company name, the method is as follows:

WebMenu.userdata = "John Doe :: 1234567890";

The method of using this control is as follows:

1: Copy the bin directory of the DLL to the solution.

2: Register on your page. The statement is:

<% @ Register tagprefix = "cswm" namespace = "coalesys.webmenu" assembly = "coalesys.webmenu"%> 3: Place the web menu object on the page.

ID = "QuickMenu"

Clearpixelimage = "/IMages/clearpixel.gif"

Popupicon = "/IMAGES/Popup.gif"

SELECTEDPOPUPICON = "/IMAGES/SelectedPopup.gif"

Runat = "Server">

4: Add menu groups and menu items.

ID = "QuickMenu"

Clearpixelimage = "/IMages/clearpixel.gif"

Popupicon = "/IMAGES/Popup.gif"

SELECTEDPOPUPICON = "/IMAGES/SelectedPopup.gif"

Runat = "Server">

CAPTION = "Home"

Runat = "Server">

CAPTION = "news"

URL = "news.aspx"

Runat = "server" />

5: Add a nested menu group and menu item.

ID = "QuickMenu"

Clearpixelimage = "/IMages/clearpixel.gif"

Popupicon = "/IMAGES/Popup.gif"

SELECTEDPOPUPICON = "/IMAGES/SelectedPopup.gif"

Runat = "Server">

CAPTION = "Home"

Runat = "Server">

CAPTION = "news"

URL = "news.aspx"

Runat = "server" />

CAPTION = "about"

URL = "about.aspx"

Runat = "server" />

CAPTION = "Products"

Runat = "Server">

CAPTION = "super widget"

URL = "superwidget.aspx"

Runat = "server" />

CAPTION = "Super Widget Pro"

URL = "SuperWidgetPro.aspx"

Runat = "server" />

转载请注明原文地址:https://www.9cbs.com/read-22107.html

New Post(0)