Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
<%@ 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 3-Jan-13 0:57am
Edited 3-Jan-13 1:07am
v4
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

use the following format:
 
<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
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
v2
Comments
URVISHSUTHAR at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 240
1 CHill60 210
2 Zoltán Zörgő 170
3 Peter Leow 170
4 Richard Deeming 166
0 Sergey Alexandrovich Kryukov 9,248
1 OriginalGriff 6,806
2 Peter Leow 4,432
3 Zoltán Zörgő 3,919
4 Richard MacCutchan 2,782


Advertise | Privacy | Mobile
Web04 | 2.8.150129.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100