Tell a friend
Link to us
Bookmark Us
Total Members
      Members: 87171
Sitemap Forum Chat

 
Resource Directory
ASP.NET Hosting (0)
Books & Media (0)
Community (0)
Components & Controls (0)
Other ASP.NET sites (0)
References (0)
Software & Server (0)
Source Code (0)
Tutorials (0)
Web Applications (0)

 
GROUP INFO
Members: 1
Access Type: Anyone can join

 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.NET Development Tips
ASP.Net Security,Internationalisation And Deployment
ASP.NET Server Controls Tips
ASP.NET Tutorial
C Sharp Tutorial
LINQ Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Javascript Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Grails Tutorial
Hibernate Tutorial
Java 1.6 Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Service-Oriented Architecture (SOA) Tutorial For Managers
Spring Tutorial
Struts Tutorial
Tomcat Tutorial

RESOURCES
Q & A (531 )
Source Code (3276 )
Articles (366 )
Books (373 )
Components (1647 )
News (899 )
Websites (1208 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Authors
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Feedback
Tell a Friend
Advertise

 

ASP.NET
BLOG
  Home > ASP.NET > Blogs > ASP.NET Podcast Show #93 - ASP.NET ListView In Orcas Beta 1 - Video
  

ASP.NET Podcast Show #93 - ASP.NET ListView In Orcas Beta 1 - Video

Subscribe


Download WMV


Download MP4


Show Notes:



  • ASP.NET ListView.

  • ListView as a Grid.

  • ListView as a Container of data.

Source Code:


ASPX Page:


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ListView.aspx.cs" Inherits="ListView" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>ListView Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:ListView ID="ListView1" runat="server" ItemContainerID="tblData">
    <layouttemplate>
        <table border="1">
            <tr>
                <th>Name</th>
            </tr>
            <tbody runat="server" id="tblData"></tbody>
        </table>
    </layouttemplate>
    <itemtemplate>
    <tr>
        <td><%# Eval("Name") %></td>
    </tr>
    </itemtemplate>
    </asp:ListView>
    <asp:ListView ID="ListView2" runat="server" ItemContainerID="ddlSelect">
    <LayoutTemplate>
        <select ID="ddlS" name="ddlS">
            <asp:PlaceHolder ID="ddlSelect" runat="server"></asp:PlaceHolder>
        </select>
    </LayoutTemplate>
    <ItemTemplate>
        <option><%# Eval("Name") %></option>
    </ItemTemplate>
    </asp:ListView>
    </div>
    </form>
</body>
</html>


Code Behind .cs file:


protected void Page_Load(object sender,EventArgs e)
{
    DataTable dtData = new DataTable();
    DataRow drData;
    dtData.Columns.Add( "Name",System.Type.GetType("System.String"));
    drData = dtData.NewRow();
    drData["Name"] = "Wally McClure";
    dtData.Rows.Add(drData);
    drData = dtData.NewRow();
    drData["Name"] = "Paul Glavich - my trusty sidekick";
    dtData.Rows.Add(drData);
    ListView1.DataSource = dtData;
    ListView1.DataBind();
    ListView2.DataSource = dtData;
    ListView2.DataBind();
}
 





From: ASP.NET Podcast
Date Published : May 23, 2007 05:00:00
 
 
 
 
 
 
 
 
Welcome Guest Signup
Member's Panel
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!

Hosting Spotlight


Product Spotlight


SEARCH
 



 
 
 
 
 


Home | Login | About Us | Contact Us | Privacy Policy | Advertising | Feedback Please