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. add/remove user (Neil Meredith control problem)

add/remove user (Neil Meredith control problem)

Scheduled Pinned Locked Moved ASP.NET
designjsonhelp
2 Posts 2 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.
  • H Offline
    H Offline
    hassanmohamed
    wrote on last edited by
    #1

    i used similar code by Neil Meredith. dynamically i add four user cntrls. when i delete the first i run into trouble(cant delete a second cntrl etc). however there is no problem with the rest. ]]> ]]> Untitled Page

    Destination

    Delete

    public partial class SmplAuditInv : System.Web.UI.UserControl { public delegate void DeleteDl(object s, EventArgs e); public DeleteDl del; protected void Page_Load(object sender, EventArgs e) { } protected void CheckBox1_CheckedChanged(object sender, EventArgs e) { del(sender, e); } } public partial class SmpAudTest : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { AddAndRemoveDynamicControls(); } private void AddAndRemoveDynamicControls() { // AurecDataAccess ada = new AurecDataAccess(); // DataSet ds = ada.TestAuditInv(); ph1.Controls.Clear(); SmplAuditInv Cntrl = null; int ControlID = 0; while (InDeletedList("uc" + ControlID)) { ControlID += 1; } //foreach (DataRow dr in ds.Tables[0].Rows) for (int i = 0; i < 4;i++ ) { if (!InDeletedList("uc" + ControlID)) { Cntrl = (SmplAuditInv)LoadControl("SmplAuditInv.ascx"); Label lb1 = (Label)Cntrl.FindControl("destLabel"); lb1.Text = "Dest:"+i; Cntrl.ID = "uc" + ControlID; Cntrl.del += new SmplAuditInv.DeleteDl(HandleRemoveUserControl); ph1

    P 1 Reply Last reply
    0
    • H hassanmohamed

      i used similar code by Neil Meredith. dynamically i add four user cntrls. when i delete the first i run into trouble(cant delete a second cntrl etc). however there is no problem with the rest. ]]> ]]> Untitled Page

      Destination

      Delete

      public partial class SmplAuditInv : System.Web.UI.UserControl { public delegate void DeleteDl(object s, EventArgs e); public DeleteDl del; protected void Page_Load(object sender, EventArgs e) { } protected void CheckBox1_CheckedChanged(object sender, EventArgs e) { del(sender, e); } } public partial class SmpAudTest : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { AddAndRemoveDynamicControls(); } private void AddAndRemoveDynamicControls() { // AurecDataAccess ada = new AurecDataAccess(); // DataSet ds = ada.TestAuditInv(); ph1.Controls.Clear(); SmplAuditInv Cntrl = null; int ControlID = 0; while (InDeletedList("uc" + ControlID)) { ControlID += 1; } //foreach (DataRow dr in ds.Tables[0].Rows) for (int i = 0; i < 4;i++ ) { if (!InDeletedList("uc" + ControlID)) { Cntrl = (SmplAuditInv)LoadControl("SmplAuditInv.ascx"); Label lb1 = (Label)Cntrl.FindControl("destLabel"); lb1.Text = "Dest:"+i; Cntrl.ID = "uc" + ControlID; Cntrl.del += new SmplAuditInv.DeleteDl(HandleRemoveUserControl); ph1

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      You might want to ask Neil.

      "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

      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