Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Difficulty Implementing Edit Row with Repeater

Difficulty Implementing Edit Row with Repeater

Scheduled Pinned Locked Moved ASP.NET
questionhtmldesignsysadminhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Scott MacMaster
    wrote on last edited by
    #1

    -------------------------------------------------------------------------------- I have an 'edit' button in each row created by my repeater. The problem I'm having is none of the controls I have in my ItemTemplate will save their state. Everything I've read said that controls listed in the template will automatically remember their view state. I can't even seem to get them to remember their state from one function to the next. Does DataBind() somehow wipe their state? Also, on a postback, why does the repeater call Repeater1_ItemCreated() twice for each item? I've made a really simple test app and it still doesn't work. What do I need to do to get this to work? In this app I'm simply trying to get each row to remember if they are in edit mode. Thanks, RepeaterEditModeTest.aspx

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="RepeaterEditModeTest.aspx.vb" Inherits="HR_RepeaterEditModeTest" %>

    <!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>
    <asp:Repeater ID="Repeater1" runat="server">
    <HeaderTemplate>
    <table>
    </HeaderTemplate>
    <ItemTemplate>
    <tr>
    <td id="rowItemRow" runat="server"></td>
    <td>
    <asp:LinkButton ID="cmdEdit" CommandName="Edit" runat="server">Edit</asp:LinkButton>
    <asp:LinkButton ID="cmdSave" CommandName="Save" runat="server">Save</asp:LinkButton>
    <asp:LinkButton ID="cmdCancel" CommandName="Cancel" runat="server">Cancel</asp:LinkButton>
    </td>
    </tr>
    </ItemTemplate>
    <FooterTemplate>
    </table>
    </FooterTemplate>
    </asp:Repeater>
    </div>
    </form>
    </body>
    </html>

    RepeaterEditModeTest.aspx.vb

    Option Explicit On
    Option Strict On

    Imports System.Collections.Generic

    Partial Class HR_RepeaterEditModeTest
    Inherits System.Web.UI.Page

    Public Data As New SortedList(Of String, Boolean)
    
    Prote
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups