Build an AJAX Based ASP.NET Web Tag Application - Part 2
page 6 of 12
by Xianzhong Zhu
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 45496/ 140

Adding a New Web Tag Category

The basic routine for adding a new web tag category is: first, select the "adding a new web tag category" command, a dialog box then pops up to prompt you to enter the new name for the category, and after clicking "OK," the new tag category will be added to the system behind the scene and the page will be updated consequently.

In detail, adding a new web tag category is also divided into two parts. First, the server-side page (AddSection.aspx) invokes the stored procedure AddSection according to the passed argument (the tag category name) to implement the adding tag category operation.

Next, the client side JavaScript code use ProtoType's "Ajax.Request" object to send out a request to page AddSection.aspx; and if the request succeeds, the new category list will be refreshed consequently. Listing 14 gives the related script code.

Listing 14

function AddSection() {
    var sectionName = window.prompt("Please enter a new tag category name");
    if (sectionName) {
        var paras = "name=" + escape(sectionName);
        new Ajax.Request("AddSection.aspx", {
            mothed: "GET",
            parameters: paras,
            onComplete: function(xmlhttp) {
                new Ajax.Request("ListSection.aspx", {onComplete: InitSection});
        });
    }
}

The following figure illustrates one of the running-time snapshots for adding a new tag category operation. When we first click the "Add a new tag category" menu item, a related dialog box pops up that requires you to enter the new name and when you press "OK," the newly-populated tag category name will be added into the tag category list.

Figure 6

Next, let us continue to see how to delete a specified tag category.


View Entire Article

User Comments

Title: Thanks   
Name: Cong Doan
Date: 2009-04-13 11:17:25 AM
Comment:
Thanks for your Article! It's wonderful!






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-10-13 12:02:38 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search