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. label viewstate not preserved

label viewstate not preserved

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

    i see many people had posted this problem. can some one please help. i have a user control with asp:label on it. the label loses its text on postback it is now a whole month i am trying to find a work around but no success.

    P P N A 4 Replies Last reply
    0
    • H hassanmohamed

      i see many people had posted this problem. can some one please help. i have a user control with asp:label on it. the label loses its text on postback it is now a whole month i am trying to find a work around but no success.

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      hassanmohamed wrote:

      i see many people had posted this problem.

      Did they get any answers?

      hassanmohamed wrote:

      it is now a whole month i am trying to find a work around but no success.

      That's sad, man.

      "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

      1 Reply Last reply
      0
      • H hassanmohamed

        i see many people had posted this problem. can some one please help. i have a user control with asp:label on it. the label loses its text on postback it is now a whole month i am trying to find a work around but no success.

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

        Are you re-binding the control every time you postback? Where are you setting the text? Can you post a few (smallish) code snippets.

        1 Reply Last reply
        0
        • H hassanmohamed

          i see many people had posted this problem. can some one please help. i have a user control with asp:label on it. the label loses its text on postback it is now a whole month i am trying to find a work around but no success.

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

          Looks like you are adding label dynamically. ASP.NET won't maintain viewstate for dynamic controls created after viewstate is loaded.

          Navaneeth How to use google | Ask smart questions

          1 Reply Last reply
          0
          • H hassanmohamed

            i see many people had posted this problem. can some one please help. i have a user control with asp:label on it. the label loses its text on postback it is now a whole month i am trying to find a work around but no success.

            A Offline
            A Offline
            Anish Gopi
            wrote on last edited by
            #5

            Check your label for following scenarios : 1. Is the property EnableViewState is set to false for the label control or its parent control 2. Is the control is being dynamically added to your page. if yes recreate the control on "Init" 3. Binding a "Null" or "Empty" value to label on postbacks

            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