.NET
  Home arrow .NET arrow Creating the Home Page for a Simple Storef...
Iron Speed
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

Creating the Home Page for a Simple Storefront with LINQ
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2008-05-06

    Table of Contents:
  • Creating the Home Page for a Simple Storefront with LINQ
  • ItemTemplate
  • A New Style
  • Preparing to Build the Product Page

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    Creating the Home Page for a Simple Storefront with LINQ
    (Page 1 of 4 )

    In the last article, we laid out the plans for a simple storefront for the Adventure Works Cycles sample database. We briefly examined the database structure, and created a master page to unify the look of our new web site. We also created a page that would display the appropriate image given a ProductID through the query string. In this article, we'll continue with the construction of the storefront.

    Creating the Home Page

    Let's create the store's home page. On this page will be a short welcome messages, a link to the product browse page, and then a short list of the latest products. We'll tackle the basic structure of the page first, and then we can move on to the meat of the page: using LINQ with ASP.NET. Create a Default.aspx page. Be sure to set its master page to MasterPage.master, which we created in the last article. The page will be created with a simple Content control. Here's the page without the latest items part:

    <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" 
    AutoEventWireup="true" CodeFile="Default.aspx.cs" 
    Inherits="_Default" Title="Adventure Works Cycles" %>


    <asp:Content ID="Content1" ContentPlaceHolderID="content" 
    Runat="Server">

    <p>Welcome to Adventure Works Cycles, your source for cycles and cycling accessories.</p>

    <p><a href="Browse.aspx">Browse Products</a></p>

    <p>Check out some of our latest items:</p>


    </asp:Content>


    Now we need a control that will display the latest items for us. Let's go with a ListView control, which is relatively new and easy to work with:


    <asp:ListView ID="LatestItemsView" runat="server">

    </asp:ListView>


    Before the ListView becomes operational, we need to provide it with a few templates. First is the LayoutTemplate, which defines the “master layout,” if you will, of the ListView. Place this inside of the ListView tags:


    <LayoutTemplate>

     <p>Here are some of our latest items:</p>

     <asp:PlaceHolder ID="itemPlaceholder" runat="server" />

     </LayoutTemplate>


    Notice how we provide a PlaceHolder control here. It's a placeholder for the list of items, and it's a necessary part of LayoutTemplate. It also must have the name “itemPlaceholder” in order to work.

    More .NET Articles
    More By Peyton McCullough


       · Hello, all. This short series shows off some of the capabilities on LINQ by building...
     

    .NET ARTICLES

    - Completing a Simple Storefront with LINQ
    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries
    - Introducing LINQ to SQL Designer using Visua...
    - Beginning LINQ to SQL Using Visual Studio 20...
    - Coding an AjaxPro.NET Based Search Engine fo...
    - Building an AjaxPro.NET Based Search Engine ...
    - Delving Deeper into Serialization with .NET
    - Serialization with .NET
    - Understanding Interface-Based Programming
    - Generics and Interface-Based Programming
    - Delving Deeper into Interface-Based Programm...
    - Interface-Based Programming
    - The Why and How of the SplitContainer Control

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway