reflection problem

  • Thread starter Thread starter Matthew
  • Start date Start date
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
 
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.
--------------------
 
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.)
 
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.)
 
Back
Top