Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<%@ 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>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div style="height: 721px">
        <asp:ListView ID="ListView1" runat="server" >
        <layouttemplate>
        <asp:PlaceHolder ID="itemplaceholder" runat="server">                    
        </layouttemplate>
        <itemtemplate>
        <table>
        <tr id="itemplaceholderid"  runat="server" >
        <td>
        <asp:Label ID="lbllistnum" runat="server" Text="Number" />
        <asp:TextBox ID="txtlistnum" runat="server"  BackColor="Aqua" />
        <asp:CheckBox ID="chklistacc" runat="server" Text="Accept" />
        <asp:CheckBox ID="chklistrej" runat="server" Text="Reject" />
        </td></table></itemtemplate></div><asp:Button ID="btnlistsave" runat="server" Text="SAVE" onclick="btnlistsave_Click" />
    </form>
</body>
</html>




I have to bind the data to textbox help me out with the code...
Posted
Updated 3-Jan-13 0:07am
v4

use the following format:

ASP.NET
<asp:textbox id="txtlistnum" runat="server" backcolor="Aqua" text="<% #Eval("ListNumber")%>" xmlns:asp="#unknown" />


You can check this link here Asp.net ListView - DataBinding[^] on how to bind data to listview


Not to mention you need to use some datasource which is populated with the data you want to show i.e., datatable, List of objects etc and then bind it to the listview.

Regards
Pawan
 
Share this answer
 
v2
 
Share this answer
 
v2
Comments
URVISH_SUTHAR1 3-Jan-13 7:51am    
i think this should work

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900