468,549 Members | 2,115 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,549 developers. It's quick & easy.

reflection problem

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
Nov 17 '05 #1
4 1319
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.
--------------------
From: "Matthew" <wa*****@eachtech.com>
Subject: reflection problem
Date: Fri, 29 Aug 2003 17:25:11 +0800
Lines: 11
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <#g*************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: 218.244.255.186
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFT NGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!tk2msftngp13.phx.gbl Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:172575
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

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


Nov 17 '05 #2


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3
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.)
"Matthew" <wa*****@eachtech.com> 写入消息新闻
:#g*************@tk2msftngp13.phx.gbl...
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

Nov 17 '05 #4

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.)
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Lev | last post: by
2 posts views Thread by Marco | last post: by
3 posts views Thread by HL | last post: by
5 posts views Thread by Klaudiusz Bryja | last post: by
6 posts views Thread by Cralis | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.