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. is viewstate written on FORM available on User Control?

is viewstate written on FORM available on User Control?

Scheduled Pinned Locked Moved ASP.NET
helpquestion
3 Posts 3 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.
  • B Offline
    B Offline
    BalasahebK
    wrote on last edited by
    #1

    Hello All Can u pls help regarding viewstate.......... I'm using user contol for some code. Also using viewstate on form1.aspx(e.g.). User control is placed on this form. I need to access form viewstate value on usercotrol. is it possible? is viewstate written on FORM available on User Control? :)Pls help me in this regard.

    Balasaheb Software Developer

    M N 2 Replies Last reply
    0
    • B BalasahebK

      Hello All Can u pls help regarding viewstate.......... I'm using user contol for some code. Also using viewstate on form1.aspx(e.g.). User control is placed on this form. I need to access form viewstate value on usercotrol. is it possible? is viewstate written on FORM available on User Control? :)Pls help me in this regard.

      Balasaheb Software Developer

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

      What is the Form viewstate value that you're looking to get? Do you mean a control value on that form that is stored in viewstate between postbacks?

      1 Reply Last reply
      0
      • B BalasahebK

        Hello All Can u pls help regarding viewstate.......... I'm using user contol for some code. Also using viewstate on form1.aspx(e.g.). User control is placed on this form. I need to access form viewstate value on usercotrol. is it possible? is viewstate written on FORM available on User Control? :)Pls help me in this regard.

        Balasaheb Software Developer

        N Offline
        N Offline
        Nitin1981
        wrote on last edited by
        #3

        Hi! You need to create a public property(set & get) in your user control.When you do this you can set the value of this property to anything your like (Viewstate in your case).

        string name;
        public string Name
        {
        set
        {
        name = value;
        }
        get
        {
        return name;
        }
        }

        Access it in form like UserControl1.Name =Viewstate["object"]; Regards

        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