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. datalist findcontrol

datalist findcontrol

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

    ight, now i have tried everything that i can think of and google so can someone please help me this is what i've tried so far: ''''''''''''''''''''''''''''''''''''''' datalist1.findcontrol ''''''''''''''''''''''''''''' e.item.findcontrol ''''''''''''''''''''''''''' For I = 0 To DataList1.Items.Count - 1 Dim blk As System.Web.UI.WebControls.ImageButton = DataList1.Items(i).FindControl("Hyperlink1") blk.BorderStyle = BorderStyle.Dotted Next ''''''''''''''''''''''''''''' e.item.findcontrol("Hyperlink1") all of this stuff i've tried in the DataList1_ItemCommand. so if someone could help me, it would be greatly appreciated! Thank You for taking a look! :-D Da Intern

    J M 2 Replies Last reply
    0
    • J jphuphilly

      ight, now i have tried everything that i can think of and google so can someone please help me this is what i've tried so far: ''''''''''''''''''''''''''''''''''''''' datalist1.findcontrol ''''''''''''''''''''''''''''' e.item.findcontrol ''''''''''''''''''''''''''' For I = 0 To DataList1.Items.Count - 1 Dim blk As System.Web.UI.WebControls.ImageButton = DataList1.Items(i).FindControl("Hyperlink1") blk.BorderStyle = BorderStyle.Dotted Next ''''''''''''''''''''''''''''' e.item.findcontrol("Hyperlink1") all of this stuff i've tried in the DataList1_ItemCommand. so if someone could help me, it would be greatly appreciated! Thank You for taking a look! :-D Da Intern

      J Offline
      J Offline
      jphuphilly
      wrote on last edited by
      #2

      Object reference not set to an instance of an object. ha ha......i forgot the error!!! Da Intern

      1 Reply Last reply
      0
      • J jphuphilly

        ight, now i have tried everything that i can think of and google so can someone please help me this is what i've tried so far: ''''''''''''''''''''''''''''''''''''''' datalist1.findcontrol ''''''''''''''''''''''''''''' e.item.findcontrol ''''''''''''''''''''''''''' For I = 0 To DataList1.Items.Count - 1 Dim blk As System.Web.UI.WebControls.ImageButton = DataList1.Items(i).FindControl("Hyperlink1") blk.BorderStyle = BorderStyle.Dotted Next ''''''''''''''''''''''''''''' e.item.findcontrol("Hyperlink1") all of this stuff i've tried in the DataList1_ItemCommand. so if someone could help me, it would be greatly appreciated! Thank You for taking a look! :-D Da Intern

        M Offline
        M Offline
        Mike Ellison
        wrote on last edited by
        #3

        Hi there. Are you sure the error is happening in the For/Next block? Though this shouldn't be the cause of the error, I think you may need to cast the FindControl() result to an ImageButton with a CType() function.

        J 1 Reply Last reply
        0
        • M Mike Ellison

          Hi there. Are you sure the error is happening in the For/Next block? Though this shouldn't be the cause of the error, I think you may need to cast the FindControl() result to an ImageButton with a CType() function.

          J Offline
          J Offline
          jphuphilly
          wrote on last edited by
          #4

          tried that too...........still doesn't work Da Intern

          M 1 Reply Last reply
          0
          • J jphuphilly

            tried that too...........still doesn't work Da Intern

            M Offline
            M Offline
            Mike Ellison
            wrote on last edited by
            #5

            Hi there. Can you post the full code and the specific lines causing the exception in context?

            J 1 Reply Last reply
            0
            • M Mike Ellison

              Hi there. Can you post the full code and the specific lines causing the exception in context?

              J Offline
              J Offline
              jphuphilly
              wrote on last edited by
              #6

              MFS Menu Security - Update Capability - Please check all that apply

              Public Sub DataListSS_ItemCommand(ByVal Sender As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataListSS.ItemCommand Dim rsChkBox As SqlDataReader = objChkBox.sProc_McCracken_ScreenSecurity_Options(e.CommandArgument.ToString()) While rsChkBox.Read CType(Page.FindControl("chkboxSS"), CheckBoxList).Items.Add(rsChkBox("options")) End While so what im tryin to do is have a datalist containing a column called screen which is a link button then from click of one of those individuals screens you get the options in a checkboxlist both the screen and options are on a sql database can you help:-D Da Intern

              J 1 Reply Last reply
              0
              • J jphuphilly

                MFS Menu Security - Update Capability - Please check all that apply

                Public Sub DataListSS_ItemCommand(ByVal Sender As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataListSS.ItemCommand Dim rsChkBox As SqlDataReader = objChkBox.sProc_McCracken_ScreenSecurity_Options(e.CommandArgument.ToString()) While rsChkBox.Read CType(Page.FindControl("chkboxSS"), CheckBoxList).Items.Add(rsChkBox("options")) End While so what im tryin to do is have a datalist containing a column called screen which is a link button then from click of one of those individuals screens you get the options in a checkboxlist both the screen and options are on a sql database can you help:-D Da Intern

                J Offline
                J Offline
                jphuphilly
                wrote on last edited by
                #7

                MFS Menu Security - Update Capability - Please check all that apply Public Sub DataListSS_ItemCommand(ByVal Sender As Object, ByVal e As DataListCommandEventArgs) Dim objChkBox As New LibrariesDB Dim rsChkBox As SqlDataReader = objChkBox.sProc_McCracken_ScreenSecurity_Options(e.commandargument.tostring) Binddatalist() While rsChkBox.Read CType(Page.FindControl("chkboxSS"), CheckBoxList).Items.Add(rsChkBox("options")) End While Da Intern

                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