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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. GridViews and Properties...

GridViews and Properties...

Scheduled Pinned Locked Moved ASP.NET
question
5 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.
  • I Offline
    I Offline
    Illegal Operation
    wrote on last edited by
    #1

    Hi! I have a Gridview that contains a TextBox that displays a Date and a Button. How can I get the Date from the TextBox and Assign it to a DateTime Property so that I can pass that to another function?

    Illegal Operation

    N 1 Reply Last reply
    0
    • I Illegal Operation

      Hi! I have a Gridview that contains a TextBox that displays a Date and a Button. How can I get the Date from the TextBox and Assign it to a DateTime Property so that I can pass that to another function?

      Illegal Operation

      N Offline
      N Offline
      nagendrathecoder
      wrote on last edited by
      #2

      You need to use Casting. Get that textbox by FindControl() method of GridView, cast it, you'll get its text property. :)

      I 1 Reply Last reply
      0
      • N nagendrathecoder

        You need to use Casting. Get that textbox by FindControl() method of GridView, cast it, you'll get its text property. :)

        I Offline
        I Offline
        Illegal Operation
        wrote on last edited by
        #3

        I have fixed the issue. Basically I changed the DateTime Property to static. Thanks for the reply's...

        Illegal Operation

        N 1 Reply Last reply
        0
        • I Illegal Operation

          I have fixed the issue. Basically I changed the DateTime Property to static. Thanks for the reply's...

          Illegal Operation

          N Offline
          N Offline
          nagendrathecoder
          wrote on last edited by
          #4

          Its good that you fixed the issue. But IMO, static variables are not too good in web applications. If possible, try to use something else, maybe a Session Variable. :)

          I 1 Reply Last reply
          0
          • N nagendrathecoder

            Its good that you fixed the issue. But IMO, static variables are not too good in web applications. If possible, try to use something else, maybe a Session Variable. :)

            I Offline
            I Offline
            Illegal Operation
            wrote on last edited by
            #5

            Thanks for that tip. I will look into using session variables in the future. I did add this variable to my Data Access Layer so its not in my web application at the moment.

            Illegal Operation

            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