Click here to Skip to main content
13,045,019 members (40,837 online)
Rate this:
Please Sign up or sign in to vote.
See more:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Listview.aspx.cs" Inherits="Listview" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head runat="server">
    <title>Untitled Page</title>
    <form id="form1" runat="server">
    <div style="height: 721px">
        <asp:ListView ID="ListView1" runat="server" >
        <asp:PlaceHolder ID="itemplaceholder" runat="server">                    
        <tr id="itemplaceholderid"  runat="server" >
        <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" />

I have to bind the data to textbox help me out with the code...
Posted 2-Jan-13 23:57pm
Updated 3-Jan-13 0:07am
Rate this: bad
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 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.

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

URVISHSUTHAR 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2017
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