.NET LinkButtons
page 2 of 6
by Troy Karhoff
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 24644/ 63

Mini databases
Let's begin by looking at some code. First, a "mini" database of products is created in the code using two instances of System.Collection.Hashtable. One hashtable stores the ProductId and ProductTitle, and the other hashtable stores the ProductId and ProductDescription. The two Hashtables are related by the ProductId. This technique is OK for demonstration purposes; however, there are cleaner ways to accomplish this.

Hashtable hashProductName = new Hashtable();
    Hashtable hashProductDesc = new Hashtable();

void BuildMiniDatabase()
    {
        hashProductName[0] = "Jalapeno Dip" ;
        hashProductDesc[0] = "Simmered in mayonaise and wine, this Jalapeno Dip will make your eyes water" ;

        hashProductName[1] = "Smoked Sausage" ;
        hashProductDesc[1] = "Mouth watering and delicious sausage" ;

        hashProductName[2] = "Shrimp Fiesta" ;
        hashProductDesc[2] = "East Coast's finest shrimp" ;

        hashProductName[3] = "Jerk Chicken" ;
        hashProductDesc[3] = "A real island experience you will not forget" ;

        hashProductName[4] = "Beer-Battered Fish" ;
        hashProductDesc[4] = "Pabst Blue Ribbon and Fish. Wow!" ;

        hashProductName[5] = "Bacon Burger" ;
        hashProductDesc[5] = "Big, juicy, and bursting with flavor" ;

        hashProductName[6] = "Sirloin Tip" ;
        hashProductDesc[6] = "Delicate cuts with no fat" ;

        hashProductName[7] = "Baked Alaska" ;
        hashProductDesc[7] = "Fine dessert comprised of sponge cake topped with ice cream and covered with meringue. The meringue is browned before the ice cream can melt." ;

        hashProductName[8] = "Fried Chicken" ;
        hashProductDesc[8] = "Country cookin'" ;

        hashProductName[9] = "Fresh Garden Salad" ;
        hashProductDesc[9] = "Crispy iceberg lettuce and a garden of vegtables" ;

        hashProductName[10] = "One Pea" ;
        hashProductDesc[10] = "A single green pea that will leave you craving more" ;

    }

View Entire Article

User Comments

Title: please upload simple example   
Name: Abidha
Date: 2010-03-01 2:00:57 AM
Comment:
this seems difficult
Title: Help for many developers!!   
Name: Vjeran
Date: 2006-03-29 12:46:51 PM
Comment:
Well.. i had problem, which is not only mine, and many developers don't know what to do but i found and answer!! Problem is in fact that, if u want to use postback u must generate controls after postback page load. If u don't render do this, evenhadler doesn't work... (?? it doesn't make sense viewstate in table control..).. Now everything works..
Title: Link Button Despair   
Name: Bruce
Date: 2005-04-04 5:15:19 PM
Comment:
I was looking for a simple example showing a link within a page linking to another section of that page.
This must be so obvious or so complex that no-one seems to be able to write a simple example.
Looking at the source of other pages that perform this miracle is unhelpful. Could you try supplying a meaningful example that sheds some light on this very desirable tool, please?
Title: Stale content   
Name: Diane
Date: 2004-12-30 11:14:03 AM
Comment:
I've been trying to find some information on using a link button for a week now. I'm finding that all the books and websites use the same limited set of examples. I will learn nothing more from your example here, than I did seeing it somewhere else. Why not go into aspects of the control that everyone else does NOT cover?
Title: broken like   
Name: Tim
Date: 2004-10-05 12:33:35 PM
Comment:
this page is a broken url on the main menu

Product Spotlight
Product Spotlight 





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


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-26 2:49:09 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search