asp.net - Dynamic Table to Edit SQL Database Data (Editable Table) -


just after bit of advice.

i have table generated using sql database , put asp:repeater display data.

the table displays fine, relevant data. happy!

but information in table may need changed user. rather having separate page or separate section user can submit edits, came idea make each cell in table text box. , on page the, text of each text box set database values.

so table display , same, except each cell editable. i'm having trouble getting work. ive got far is:

<asp:repeater id="rptpending" runat="server">     <headertemplate>         <table id="tblpending" cellpadding="0" cellspacing="0" border="0" class="display">             <thead>                 <tr>                     <th>company name</th>                     <th>telephone</th>                     <th>fax number</th>                     <th>address line 1</th>                     <th>address line 2</th>                     <th>city</th>                     <th>postcode</th>                     <th>company user</th>                 </tr>             </thead>             <tbody>     </headertemplate>     <itemtemplate>         <form id="form" runat="server">             <tr>                 <td><asp:textbox id="companyname" runat="server" autopostback="true" text="<%# eval("_companyname") %>"></asp:textbox></td>                 <td><asp:textbox id="companyname" runat="server" autopostback="true" text="<%# eval("_telephone")%>"></asp:textbox></td>                 <td><asp:textbox id="companyname" runat="server" autopostback="true" text="<%# eval("_faxno")%>"></asp:textbox></td>                 <td><asp:textbox id="companyname" runat="server" autopostback="true" text="<%# eval("_addressln1")%>"></asp:textbox></td>                 <td><asp:textbox id="companyname" runat="server" autopostback="true" text="<%# eval("_addressln2")%>"></asp:textbox></td>                 <td><asp:textbox id="companyname" runat="server" autopostback="true" text="<%# eval("_city")%>"></asp:textbox></td>                 <td><asp:textbox id="companyname" runat="server" autopostback="true" text="<%# eval("_postcode")%>"></asp:textbox></td>                 <td><asp:textbox id="companyname" runat="server" autopostback="true" text="<%# eval("_name")%>"></asp:textbox></td>             </tr>         </form>     </itemtemplate>     <footertemplate>         </tbody> </table>     </footertemplate> </asp:repeater> 

in old method,between [td] tags literally had <%# eval("variable") %> statement. changed asp:textbox tag.

i error saying server tag not formed.

if knows work around or better method, appreciated:)

thanks,

alex

p.s. no references asp:datatable or gridview. im not interested in them

the reason why you're getting "not formed" error you're using double quotes around eval statement , inside them well. use single quotes surrounding quotes.

<td>    <asp:textbox         id="companyname"         runat="server"         autopostback="true"         text='<%# eval("_companyname") %>'     >    </asp:textbox>  </td> 

this not solve overall problem of trying edit multiple items through repeater. if text in of these boxes modified, how know row pertains to?

have fun you're trying, suspect find becoming interested in datatable , gridview.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -