473,394 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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
Nov 15 '05 #1
1 6440
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" <in**@fretweb.com> wrote in message
news:6c**************************@posting.google.c om...
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

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: tony lock | last post by:
I am writing a simulation program, the main classes inherit from a base class which itself inherits from Control. I am using reflection to serialize these objects including the fields from control....
2
by: Dan | last post by:
hi newsgroup, i need server side validation of user entries. as i do have many fields, i would like to use reflection for checkinng the IsValid property of all the Validators. here is the...
6
by: Sameh Ahmed | last post by:
Hello there I need to get the "PwdLastSet" of a user object to know when he last set his password. I am using DirectoryServices.DirectoryEntry to bind to the user object, but it either gives...
12
by: Sadeq | last post by:
Is there a way to read a struct field by field? I want to write a rather general function, like: public string EncodeStruct (struct strct) { .... } which accepts a general struct type,...
20
by: Shawnk | last post by:
I would like to get the class INSTANCE name (not type name) of an 'object'. I can get the object (l_obj_ref.GetType()) and then get the (l_obj_typ.Name) for the class name. I there any way of...
1
by: samhng | last post by:
Hi, Suppose I have a class: public class Test { public string a; public int b; } Now I want to access the value of variable a of the instance of the class Test (@_@). public class App
5
by: jdzemke | last post by:
I am getting 'options' is null or not an object using when using a dynamic dataset with a dropdown list in an html form. I am filling-in a text field and filtering the values in the drop-down. ...
4
by: colin | last post by:
How can I access a field contained in fieldInfo by reference so I can pass it to a function ? ive tried __refvalue but this needs a type known at compile time, I can access it with SetValue and...
2
by: gz | last post by:
Good morning everyone, I am writing a module that needs to access fields in classes efficiently. The trouble is that the module does not know the classes beforehand, although the user of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.