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. checkbox control and rowID

checkbox control and rowID

Scheduled Pinned Locked Moved ASP.NET
helptutorial
4 Posts 3 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.
  • K Offline
    K Offline
    karinb
    wrote on last edited by
    #1

    as a newbie, I have developed a simple administrative app that lists members of our mailing list. ON the viewing page, checkboxes are dynamically listed along with the member info. When one checks a box and clicks 'edit', i want the item checked to open into the edit page with it's appropriate data. Problem: I can get the checkbox associated to an id number on the viewing page. I just can't seem to figure out how to send that id and data to the edit page. any help or suggestions would be great. can provide code examples if needed. karinb karinb

    P M 2 Replies Last reply
    0
    • K karinb

      as a newbie, I have developed a simple administrative app that lists members of our mailing list. ON the viewing page, checkboxes are dynamically listed along with the member info. When one checks a box and clicks 'edit', i want the item checked to open into the edit page with it's appropriate data. Problem: I can get the checkbox associated to an id number on the viewing page. I just can't seem to figure out how to send that id and data to the edit page. any help or suggestions would be great. can provide code examples if needed. karinb karinb

      P Offline
      P Offline
      Paddy Boyd
      wrote on last edited by
      #2

      in the querystring if it's just simple data...

      1 Reply Last reply
      0
      • K karinb

        as a newbie, I have developed a simple administrative app that lists members of our mailing list. ON the viewing page, checkboxes are dynamically listed along with the member info. When one checks a box and clicks 'edit', i want the item checked to open into the edit page with it's appropriate data. Problem: I can get the checkbox associated to an id number on the viewing page. I just can't seem to figure out how to send that id and data to the edit page. any help or suggestions would be great. can provide code examples if needed. karinb karinb

        M Offline
        M Offline
        MontenegroATL
        wrote on last edited by
        #3

        From viewing page you can use code similar to this Dim trans_id As Integer Dim dgrCode As Label = E.Item.FindControl("lblCode") trans_id = CType(dgrCode.Text, Integer) Server.Transfer("EditList.aspx?&trans_id=" + trans_id.ToString(), True) which does this: reads value from control named lblCode. Since I needed to transfer this value to next page as integer, I casted it. Last line of code redirects user to "edit list" page along with value from the control In Edit List page under Page Load or somwhere else have line similar to this. lblTest.Text = Request.Params.Get("trans_id") What this does: it reads a parameter sent from viewing page and assign its value to text box. I hope this gives you the general idea Srdjan

        K 1 Reply Last reply
        0
        • M MontenegroATL

          From viewing page you can use code similar to this Dim trans_id As Integer Dim dgrCode As Label = E.Item.FindControl("lblCode") trans_id = CType(dgrCode.Text, Integer) Server.Transfer("EditList.aspx?&trans_id=" + trans_id.ToString(), True) which does this: reads value from control named lblCode. Since I needed to transfer this value to next page as integer, I casted it. Last line of code redirects user to "edit list" page along with value from the control In Edit List page under Page Load or somwhere else have line similar to this. lblTest.Text = Request.Params.Get("trans_id") What this does: it reads a parameter sent from viewing page and assign its value to text box. I hope this gives you the general idea Srdjan

          K Offline
          K Offline
          karinb
          wrote on last edited by
          #4

          I truly appreciate your solution, just wish i could figure out how to implement it. i should have mentioned i'm developing in c#. Here's what I've tried to do with your sample: --this is in my Page_Load--- --creates an instance of a checkbox and dynamically populates inline with the list of users and sets its value to the same as the pk of the associated dataset--- CheckBox cboCheck = new CheckBox(); cboCheck.AutoPostBack = false; cboCheck.ID = dsUserInfo.Tables[0].Rows[intCtr]["intMailIDpk"].ToString(); ---Event Handler public void btnEdit_Click(object sender,System.EventArgs e) { --->getting error message at this line: Object reference not set to an instance of an object.-- Int16 ckID = Convert.ToInt16(cboCheck.ID); cboCheck.ID = Convert.ToString(cboCheck.FindControl("ckID")); Server.Transfer("addedit.aspx?&ckID=" + ckID.ToString(), false);--probably need to user Response.Redirect here, you think??-- } any help is greatly appreciated. i'm sure i'm just one line of code off here, and then my app works great. karinb -- modified at 15:11 Tuesday 9th May, 2006

          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