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. UserControl and data from Default.aspx ?

UserControl and data from Default.aspx ?

Scheduled Pinned Locked Moved ASP.NET
csharpquestionasp-nethelp
8 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.
  • S Offline
    S Offline
    steffw
    wrote on last edited by
    #1

    How can i get data from my Default.aspx to my Control? I've tried several things, like creating a property in the classes, but it still wont work I can't figure it out :( I'm using asp.net with c# in 2.0 please help! Thanks in advance :)

    Stef

    S G 2 Replies Last reply
    0
    • S steffw

      How can i get data from my Default.aspx to my Control? I've tried several things, like creating a property in the classes, but it still wont work I can't figure it out :( I'm using asp.net with c# in 2.0 please help! Thanks in advance :)

      Stef

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

      steffw wrote:

      How can i get data from my Default.aspx to my Control?

      Which control ? is it any user or custom control ?

      steffw wrote:

      I've tried several things, like creating a property in the classes, but it still wont work

      Why ? Can you post what you have done and What type of control are you using ?

      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... "

      S 1 Reply Last reply
      0
      • S Sandeep Akhare

        steffw wrote:

        How can i get data from my Default.aspx to my Control?

        Which control ? is it any user or custom control ?

        steffw wrote:

        I've tried several things, like creating a property in the classes, but it still wont work

        Why ? Can you post what you have done and What type of control are you using ?

        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... "

        S Offline
        S Offline
        steffw
        wrote on last edited by
        #3

        It is an UserControl, and i've tried to cast the page class in the user control and tried to at a property... But I noticed that you needed namespaces for that and I don't use those

        Stef

        S 1 Reply Last reply
        0
        • S steffw

          How can i get data from my Default.aspx to my Control? I've tried several things, like creating a property in the classes, but it still wont work I can't figure it out :( I'm using asp.net with c# in 2.0 please help! Thanks in advance :)

          Stef

          G Offline
          G Offline
          GgAben
          wrote on last edited by
          #4

          1. You can add a public property and initialize it from the page initialize method. If you are using property then you can assingn value through html code in the aspx page or dynamically pass value throgh code behind 2. You can use session, application etc.. variables for passing data.

          Gg

          S 1 Reply Last reply
          0
          • S steffw

            It is an UserControl, and i've tried to cast the page class in the user control and tried to at a property... But I noticed that you needed namespaces for that and I don't use those

            Stef

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

            Why don't you pass the value using Session/ QueryString to pass those values from Default to other page Where you are using USer Control

            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
            • G GgAben

              1. You can add a public property and initialize it from the page initialize method. If you are using property then you can assingn value through html code in the aspx page or dynamically pass value throgh code behind 2. You can use session, application etc.. variables for passing data.

              Gg

              S Offline
              S Offline
              steffw
              wrote on last edited by
              #6

              I've tried the first one, didn't work out... I'm now using sessions but is this good for the performance?

              Stef

              G 1 Reply Last reply
              0
              • S steffw

                I've tried the first one, didn't work out... I'm now using sessions but is this good for the performance?

                Stef

                G Offline
                G Offline
                GgAben
                wrote on last edited by
                #7

                If you are using small amount of data it will not affect performance. But it will be a performance hit if there is a large amount of data, because session uses application memory area. Please read the following articles. Then decide which you can use. http://msdn2.microsoft.com/en-us/library/87069683.aspx[^] http://aspnet.4guysfromrolla.com/articles/100902-1.aspx[^] http://ggaben-developer.blogspot.com/[^]

                Gg

                S 1 Reply Last reply
                0
                • G GgAben

                  If you are using small amount of data it will not affect performance. But it will be a performance hit if there is a large amount of data, because session uses application memory area. Please read the following articles. Then decide which you can use. http://msdn2.microsoft.com/en-us/library/87069683.aspx[^] http://aspnet.4guysfromrolla.com/articles/100902-1.aspx[^] http://ggaben-developer.blogspot.com/[^]

                  Gg

                  S Offline
                  S Offline
                  steffw
                  wrote on last edited by
                  #8

                  ooh :) It's just an object with 5 properties so it won't be necesarry to cache it :) Thanks for the usefull advice & links :) I appreciate it :)

                  Stef

                  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