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

reaching the parent

I want to get the parent of the user control.

PortalModuleControl portalModule = (PortalModuleControl) this.Parent;

but i get an error Specific cast is not valid.
and this is my class

public class PortalModuleControl : UserControl {

does anybody have any idea?

Thanks
--
Esref DURNA
Soft. Eng.

Nov 19 '05 #1
1 840
well it depends what "this" is set to i.e. which class you are calling it
from.

to debug it, assign this.Parent to a variable of type Object and then look
at it in the debugger. this will tell you what type of object the parent
actually is

"Esref DURNA" <es*********@microsoft.com> wrote in message
news:23**********************************@microsof t.com...
I want to get the parent of the user control.

PortalModuleControl portalModule = (PortalModuleControl) this.Parent;

but i get an error Specific cast is not valid.
and this is my class

public class PortalModuleControl : UserControl {

does anybody have any idea?

Thanks
--
Esref DURNA
Soft. Eng.

Nov 19 '05 #2

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

Similar topics

2
by: Java_Forum | last post by:
hi, here is my main html file INDEX.JSP ------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <META name="GENERATOR" content="IBM WebSphere Studio">...
4
by: wenjie wang | last post by:
Greetings, I'd like to know is there any situation where your program could crash without reaching the breakpoint which you set at the beginning of main().
1
by: leo | last post by:
Hello guys I have a problem when reaching the end of file (EOF). Is there any way I can start at the beggining of file (BOF) when looped second time sample code <% Do While Not rstA.EOF
1
by: sweety | last post by:
fread hangs before reaching eof() Hi, I'm reading the datat from the file. I could read the data by fread but it hangs on last data. its juz before reaching eof(). The same file could read...
7
by: prakashleo | last post by:
hi to all I am using vb 6.0 I want to move to the next line in the text box after reaching text length 70 characters can any one help me
2
by: suneet.taparia | last post by:
Hi, On IE7 I'm using a script: function saveValues() { var validateOK=true; if (typeof validate !='undefined') validateOK = validate(document.EditForm);
7
by: newbie | last post by:
hi, I have the following construct: public class Form1:System.Windows.Forms.Form { ..... ----a TextBox is created by the Designer in this area: 'textBox1' ..... }
3
by: carl.dhalluin | last post by:
Hi, I am playing with the atexit module but I don't find a way to see the difference between a script calling sys.exit(<returncode>) and the interpreting arriving at the end of the source code...
1
by: CCHDGeek | last post by:
I am automating a process using Access 2003 (SP2) by importing csv files as tables. The amount of data was causing the database to reach the 2gb limit. Now I am deleting the tables after I am...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.