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. maintain values of a textbox on Postback

maintain values of a textbox on Postback

Scheduled Pinned Locked Moved ASP.NET
help
8 Posts 5 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.
  • A Offline
    A Offline
    Archana New to Dotnet
    wrote on last edited by
    #1

    Hi, I have a textbox which gets value from a calender control.To avoid users from manually typing I have diabled the textbox,The problem is on Postback the Textbox value i.e the date value is getting cleared. I have also tried it using Readonly Property same problem. Can any one please give me a solution , Thanks is Advance. Archana

    M N M 3 Replies Last reply
    0
    • A Archana New to Dotnet

      Hi, I have a textbox which gets value from a calender control.To avoid users from manually typing I have diabled the textbox,The problem is on Postback the Textbox value i.e the date value is getting cleared. I have also tried it using Readonly Property same problem. Can any one please give me a solution , Thanks is Advance. Archana

      M Offline
      M Offline
      MaheshSharma
      wrote on last edited by
      #2

      I thing you have you set the autopostback property of textbox set to false cheers

      A 1 Reply Last reply
      0
      • M MaheshSharma

        I thing you have you set the autopostback property of textbox set to false cheers

        A Offline
        A Offline
        Archana New to Dotnet
        wrote on last edited by
        #3

        No ,I didnt set the Autopost back,Since Im getting the value from calender control the page is automatically getting refreshed.

        M 1 Reply Last reply
        0
        • A Archana New to Dotnet

          Hi, I have a textbox which gets value from a calender control.To avoid users from manually typing I have diabled the textbox,The problem is on Postback the Textbox value i.e the date value is getting cleared. I have also tried it using Readonly Property same problem. Can any one please give me a solution , Thanks is Advance. Archana

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          View state is maintaining value on postbacks. So try disabling viewstate for the textbox.


          My Website | Ask smart questions

          1 Reply Last reply
          0
          • A Archana New to Dotnet

            No ,I didnt set the Autopost back,Since Im getting the value from calender control the page is automatically getting refreshed.

            M Offline
            M Offline
            MaheshSharma
            wrote on last edited by
            #5

            Set the autopostback = false in aspx page check it

            K 1 Reply Last reply
            0
            • A Archana New to Dotnet

              Hi, I have a textbox which gets value from a calender control.To avoid users from manually typing I have diabled the textbox,The problem is on Postback the Textbox value i.e the date value is getting cleared. I have also tried it using Readonly Property same problem. Can any one please give me a solution , Thanks is Advance. Archana

              M Offline
              M Offline
              Michael Sync
              wrote on last edited by
              #6

              How did you disable this textbox? There is a reason why i ask this question. There are some differences between disabling textbox explicitly and disabling parent container control (eg: Panel or DIV).

              Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

              M 1 Reply Last reply
              0
              • M Michael Sync

                How did you disable this textbox? There is a reason why i ask this question. There are some differences between disabling textbox explicitly and disabling parent container control (eg: Panel or DIV).

                Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

                M Offline
                M Offline
                Michael Sync
                wrote on last edited by
                #7

                This link said that ~

                Question 3. Why all data from web controls within the disabled panel has been lost during the postback? It’s pretty strange. In window-based application, we only need to disable the panel if we want to disable all controls inside this panel. But we can’t do like that in web development. ASP.NET doesn’t keep the viewstate of the controls if the panel is disabled so that all data in those controls within disabled panel will be lost during the PoskBack. The solution for this problem is that enable or disable each each and every controls inside the disabled panel. Enable explicitly. Scott Mitchell wrote very good article about this problem and solution in this blog.. You may check his article “Panel Weirdness” here.

                Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

                1 Reply Last reply
                0
                • M MaheshSharma

                  Set the autopostback = false in aspx page check it

                  K Offline
                  K Offline
                  kumar a
                  wrote on last edited by
                  #8

                  hi its very fine

                  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