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. read check box control's value in datalist

read check box control's value in datalist

Scheduled Pinned Locked Moved ASP.NET
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.
  • D Offline
    D Offline
    deepalititi
    wrote on last edited by
    #1

    i have data list which has check box in item template. i bound this data list to data source through coding. but when i try to read check box values which are checked i donot get any value though check box is checked. my code is like protected void Button1_Click(object sender, EventArgs e) { foreach (DataListItem _obj in dlAddressType.Items) { if (_obj.ItemIndex > -1) { Label _lbl = (Label)_obj.FindControl("lblAddressTypeID"); int chkID; string chkVal; chkVal = _lbl.Text; chkID = Convert.ToInt32(chkVal); CheckBox _checkBox = (CheckBox)_obj.FindControl("chkAddressType"); if (flag != 1) { if (_checkBox.Checked == true) { _ag.AddAddress(ad); // now the addressGroup object has 2 addresses in it. // indicate this is the shipping address AddressTypeID = 5 _ag._AddressDetails[chkID].AddressClientSideID = ad.ClientSideID; } } else { if (_checkBox.Checked == true) { _ag = new AddressGroup(ad); _ag._AddressDetails[chkID].AddressClientSideID = ad.ClientSideID; flag = 0; } } } } }

    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