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. viewstate of dropdown

viewstate of dropdown

Scheduled Pinned Locked Moved ASP.NET
question
6 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.
  • P Offline
    P Offline
    priyank_ldce
    wrote on last edited by
    #1

    Hi all, I am creating dynamic dropdownlist in my webpage. Now on postback is it possible to get viewstate of this dynamically created dropdownlist in Page_Load methode? Thanks, Priyank

    S N 2 Replies Last reply
    0
    • P priyank_ldce

      Hi all, I am creating dynamic dropdownlist in my webpage. Now on postback is it possible to get viewstate of this dynamically created dropdownlist in Page_Load methode? Thanks, Priyank

      S Offline
      S Offline
      Sathesh Sakthivel
      wrote on last edited by
      #2

      Yes.

      SSK.

      P 1 Reply Last reply
      0
      • S Sathesh Sakthivel

        Yes.

        SSK.

        P Offline
        P Offline
        priyank_ldce
        wrote on last edited by
        #3

        Thanks, But how can I get it? only thing I have is ID of the dropdownlist at that time. Priyank

        1 Reply Last reply
        0
        • P priyank_ldce

          Hi all, I am creating dynamic dropdownlist in my webpage. Now on postback is it possible to get viewstate of this dynamically created dropdownlist in Page_Load methode? Thanks, Priyank

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

          priyank_ldce wrote:

          I am creating dynamic dropdownlist in my webpage.

          Are you using a content place holder ?

          priyank_ldce wrote:

          Now on postback is it possible to get viewstate of this dynamically created dropdownlist in Page_Load methode?

          Viewstates will be loaded before page_load fires. Getting viewstate depends on where you are creating dynamic control. If it is in page_load or any other events fired after Init(), it won't be maintained. If ASP.NET want to maintain viewstate for your dynamic control, create it on Init() event.


          My Website | Ask smart questions

          P 1 Reply Last reply
          0
          • N N a v a n e e t h

            priyank_ldce wrote:

            I am creating dynamic dropdownlist in my webpage.

            Are you using a content place holder ?

            priyank_ldce wrote:

            Now on postback is it possible to get viewstate of this dynamically created dropdownlist in Page_Load methode?

            Viewstates will be loaded before page_load fires. Getting viewstate depends on where you are creating dynamic control. If it is in page_load or any other events fired after Init(), it won't be maintained. If ASP.NET want to maintain viewstate for your dynamic control, create it on Init() event.


            My Website | Ask smart questions

            P Offline
            P Offline
            priyank_ldce
            wrote on last edited by
            #5

            N a v a n e e t h wrote:

            Are you using a content place holder ?

            Yes I am using content place holder.

            N a v a n e e t h wrote:

            Viewstates will be loaded before page_load fires. Getting viewstate depends on where you are creating dynamic control. If it is in page_load or any other events fired after Init(), it won't be maintained. If ASP.NET want to maintain viewstate for your dynamic control, create it on Init() event.

            I am creating dropdownlist on Page_load event. I want to use value of this dropdownlist for other control in Page_load event.

            N 1 Reply Last reply
            0
            • P priyank_ldce

              N a v a n e e t h wrote:

              Are you using a content place holder ?

              Yes I am using content place holder.

              N a v a n e e t h wrote:

              Viewstates will be loaded before page_load fires. Getting viewstate depends on where you are creating dynamic control. If it is in page_load or any other events fired after Init(), it won't be maintained. If ASP.NET want to maintain viewstate for your dynamic control, create it on Init() event.

              I am creating dropdownlist on Page_load event. I want to use value of this dropdownlist for other control in Page_load event.

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

              priyank_ldce wrote:

              Yes I am using content place holder.

              Well, if you are using Content place holder, then what is the issue ? FindControl() is not working for you ?


              My Website | Ask smart questions

              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