reflection problem

M

Matthew

hi dear members, i have derived my aspx code behind class from a
'BasePage'.in this BasePage, i put some formatting functions in it. I also
write some customer controls, in one control, i have to call BasePage's
function 'foo'. But when i use reflection to call 'foo', Type
t=Page.GetType() always returns system.web.ui.page, i can't invoke 'foo' by
t.InvokeMethod("foo",...).How can i sovle this?

regards
wanghui
 
C

Charlie Nilsson [MSFT]

I'm having a bit of trouble understanding your question, but I believe you
may want to try "this.GetType()" vs. Page.GetType.

Hope that helps.



Charlie Nilsson [msft]
Visual Studio Update

--

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
--------------------
 
M

Matthew

hi,thanks for your reply!
there are 2 separe projects in my asp.net solution.
one is webUI(mainly some aspx files),the other is webControl(some custom
controls).I have all my aspx file's code behind file inherited from
BasePage.So,the question is: how can i invoke BasePage's function from my
custom control in project webControl?( to use custom controls in aspx files,
i have to add webControl as a reference of webUI, so i can't add webUI as a
reference of webControl, i think using reflection can solve this, but I
don't know how to.)
 
H

hui wang

hi,thanks for your reply!
there are 2 separe projects in my asp.net solution.
one is webUI(mainly some aspx files),the other is webControl(some custom
controls).I have all my aspx file's code behind file inherited from
BasePage.So,the question is: how can i invoke BasePage's function from
my custom control in project webControl?( to use custom controls in aspx
files, i have to add webControl as a reference of webUI, so i can't add
webUI as a reference of webControl, i think using reflection can solve
this, but I don't know how to.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top