473,396 Members | 1,816 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,396 software developers and data experts.

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 1528
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tim Werth | last post by:
I am trying to use reflection to add an event handler for the RowUpdated event of the OracleDataAdapter object (ODP.NET), but the same thing can be said for SqlDataAdapter if you only use...
10
by: Sunny | last post by:
Hi, I have an old problem which I couldn't solve so far. Now I have found a post in that group that gave me an idea, but I can not fully understand it. The problem is: I'm trying to use a...
2
by: Jason Coyne Gaijin42 | last post by:
I have seen several people looking for a way to access the Columns collection when using the AutoGenerate = true option. Some people have gotten so far as to find the private autoGenColumnsArray...
2
by: Lev | last post by:
Hi, I have some code that does reflection on an assembly I load. When I try to get the attributes on one of the methods implemented in the assembly, the MC++ version does not return anything....
2
by: Marco | last post by:
Hi, I try to use reflection to retrieve class B members and not inherited members. I wonder why the myMember value is nothing. Any suggestions? Thanks Module Module1 Sub Main()
3
by: HL | last post by:
The requirement is to send some information to other objects. The objects to whom the information has to be sent is not available at compile time. The names of the types (objects) will be provided...
7
by: Paul Hadfield | last post by:
Hi, I'm running into one problem with trying to call "Type.GetCustomAttributes(...)" on my reflected code. Basically - I can't trap my own custom attribute - I can only catch / identify system...
5
by: Klaudiusz Bryja | last post by:
Hi, This is for NetCF 2.0. I need to create event handling code which using reflection. I have some parameters in XML which describe how event should be handled. I have code to create...
6
by: Cralis | last post by:
Hi guys, Someone once said, 'You can do that with reflection'. I can't recall what it was I was trying to do at the time, but then he said, 'Any developer knows what reflection is...'. I kept...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.