access varibles defined on a masterPage from user control

Last post 09-25-2009 10:35 PM by jamxi. 2 replies.

Sort Posts:

  • access varibles defined on a masterPage from user control

    09-24-2009, 7:29 PM
    • Member
      4 point Member
    • jamxi
    • Member since 10-10-2007, 5:51 PM
    • Posts 36

    I have a masterPage with codebehind defining some variables.  I also have a control on the master page that is meant to display content based on the variables I set in the codebehind of the masterpage.  What I'm wondering is there a way to access the variables I created on the masterpage from inside the user control?  I've been struggling with this for awhile and can't seem to find a way to do this?  Any help would be greatly appreciated.

    Thanks

  • Re: access varibles defined on a masterPage from user control

    09-25-2009, 12:16 AM
    • Contributor
      4,915 point Contributor
    • karthicks
    • Member since 01-09-2009, 12:43 PM
    • Chennai
    • Posts 849

    hi,

    declare a property in master page to return the variable and use that in your usercontrol

    If this post is useful,
    Please,Dont Forget to click Mark As Answer and Earn Your Point

    Thanks,
    Karthick S
    Celebrate Programming
  • Re: access varibles defined on a masterPage from user control

    09-25-2009, 10:35 PM
    Answer
    • Member
      4 point Member
    • jamxi
    • Member since 10-10-2007, 5:51 PM
    • Posts 36

    I couldn't get that to work either.  I could access the property from the code behind of the page, but not from the user control.  I ended up creating a class instead as a work around.  From what I've found online my problem seems to be common thing of not working the way I'm trying to do it.  Anyway thanks for the suggestion.

Page 1 of 1 (3 items)