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. Passing values between user controls

Passing values between user controls

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netwinformscomtutorial
5 Posts 3 Posters 1 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
    Het2109
    wrote on last edited by
    #1

    How to pass values between user controls in same Asp.Net page ? Thanks in advance!

    Het Waghela :)Be Humble in Victory and Strong in Defeat.:) Het Waghela, Blog|Het Waghela DotNet Questions Link|More Links

    V S 2 Replies Last reply
    0
    • H Het2109

      How to pass values between user controls in same Asp.Net page ? Thanks in advance!

      Het Waghela :)Be Humble in Victory and Strong in Defeat.:) Het Waghela, Blog|Het Waghela DotNet Questions Link|More Links

      V Offline
      V Offline
      Venkatesh Mookkan
      wrote on last edited by
      #2

      Use Properties to set or get the values between UserControls.

      [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

      H 1 Reply Last reply
      0
      • V Venkatesh Mookkan

        Use Properties to set or get the values between UserControls.

        [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

        H Offline
        H Offline
        Het2109
        wrote on last edited by
        #3

        You mean, set/get properties in a user control, define that user control in another control and access the values ?

        Het Waghela :)Be Humble in Victory and Strong in Defeat.:) Het Waghela, Blog|Het Waghela DotNet Questions Link|More Links

        V 1 Reply Last reply
        0
        • H Het2109

          You mean, set/get properties in a user control, define that user control in another control and access the values ?

          Het Waghela :)Be Humble in Victory and Strong in Defeat.:) Het Waghela, Blog|Het Waghela DotNet Questions Link|More Links

          V Offline
          V Offline
          Venkatesh Mookkan
          wrote on last edited by
          #4

          Het2109 wrote:

          You mean, set/get properties in a user control, define that user control in another control and access the values ?

          Your question is little bit confusing. Let me explain my point. Assume that you are having a User Control with a Text Box. You want to set/get the Text of the TextBox in that usercontrol. In that case, add a Text property to the Usercontrol and in that property you update the TextBox in the usercontrol. Here the values in the usercontrol is accessed. You can implement the same logic in your controls too. If your control has a complicated UI, make use of functions which could return the values in required datatypes or your own class object. I hope, you understand my point.

          [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

          1 Reply Last reply
          0
          • H Het2109

            How to pass values between user controls in same Asp.Net page ? Thanks in advance!

            Het Waghela :)Be Humble in Victory and Strong in Defeat.:) Het Waghela, Blog|Het Waghela DotNet Questions Link|More Links

            S Offline
            S Offline
            Sandeep Akhare
            wrote on last edited by
            #5

            There are many ways to perform your task, You can have properties in your page instead of user control can access them from the user control , or create a function that is going to call by page by passing all parameters from one user control to other, You can even have a property that will return the whole user control and can access in other user control but its not good practice. So there can be n different solution the best one you have to pick depending on your requirements.

            Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

            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