Dynamically loaded user controls and setValue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marconline
    New Member
    • Jun 2008
    • 4

    #1

    Dynamically loaded user controls and setValue

    Hi this is Marco from Italy.

    I instantiate a lot of user controls on runtime and I set a property (for each control) through Reflection.setV alue method.

    It seems that if I do a post back and try to access to the same setted property (through Reflection.GetP roperties().get Value(...)) it gives back an empty string.

    Why?

    Thanks, Marco
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Originally posted by marconline
    Hi this is Marco from Italy.

    I instantiate a lot of user controls on runtime and I set a property (for each control) through Reflection.setV alue method.

    It seems that if I do a post back and try to access to the same setted property (through Reflection.GetP roperties().get Value(...)) it gives back an empty string.

    Why?

    Thanks, Marco
    Where are you instantiating your objects?
    Have you seen the article on how to use dynamic controls in ASP.NET?

    -Frinny

    Comment

    • marconline
      New Member
      • Jun 2008
      • 4

      #3
      Originally posted by Frinavale
      Where are you instantiating your objects?
      Have you seen the article on how to use dynamic controls in ASP.NET?

      -Frinny
      Hi Frinny and thanks for your reply. My controls are instantiated after the page load . I know that they should be instantiated in the page.init, but is this the problem?

      Thanks,
      Marco

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by marconline
        Hi Frinny and thanks for your reply. My controls are instantiated after the page load . I know that they should be instantiated in the page.init, but is this the problem?

        Thanks,
        Marco

        I think that could be your problem.

        Comment

        Working...