Getting Field Value with Reflection?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    #1

    Getting Field Value with Reflection?

    Hello,

    I'm currently using reflection to get some data from an assembly
    created from a web form that has elements such as a DataGrid, DataSet,
    etc. I also have a label control. Getting the fields, methods, etc
    is no problem but where I'm having difficulty is obtaining the text
    value assigned to the label (on the button click). I can see the
    string in ilDasm.exe but having trouble picking it up with GetValue().
    Any info would be appreciated.

    Johnny
  • Chris Capel

    #2
    Re: Getting Field Value with Reflection?

    What sort of trouble are you having? Keep in mind, if you're using
    Label.Text, and not the private field, you're looking at a property, not a
    field, so you having to use the appropriate flags.

    Chris

    "John" <info@fretweb.c om> wrote in message
    news:6c694c7a.0 307301151.53cf3 664@posting.goo gle.com...[color=blue]
    > Hello,
    >
    > I'm currently using reflection to get some data from an assembly
    > created from a web form that has elements such as a DataGrid, DataSet,
    > etc. I also have a label control. Getting the fields, methods, etc
    > is no problem but where I'm having difficulty is obtaining the text
    > value assigned to the label (on the button click). I can see the
    > string in ilDasm.exe but having trouble picking it up with GetValue().
    > Any info would be appreciated.
    >
    > Johnny[/color]


    Comment

    Working...