473,834 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why is my ascx control begin cast to ASP."classname" ?

xs
I have a master page which has a class name "GlobalPage " created in Web
namespace.
I created a string property called connectionStrin g in this GlobalPage
class.

I have a ascx control loaded in this GlobalPage which is working fine until
the day I need to access the connectionStrin g property in the GlobalPage
from my ascx control. This is what I wrote :

this.connection String = ((Web.GlobalPag e)this.Page.Mas ter).Connection String;

This compiles perfectly. However I received the following runtime error :

"An exception of type 'System.Invalid CastException' occurred in
App_Web_zjl86e8 a.dll but was not handled in user code

Additional information: Unable to cast object of type 'ASP.GlobalPage ' to
type Web.GlobalPage' ."

I have the following declared at my master page and ascx respectively.
Master Page
<%@ Master Language="C#" AutoEventWireup ="true"
CodeFile="Globa lPage.master.cs " Inherits="Web.G lobalPage"

ClassName="Glob alPage" %>

Ascx Control

<%@ Control Language="C#" AutoEventWireup ="true" CodeFile="SideB ar.ascx.cs"
Inherits="Web.S ideBar" ClassName="Side Bar"%>

Any help is appreciated. Thanks
May 4 '06 #1
0 1361

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

Similar topics

3
5753
by: Ante Perkovic | last post by:
Hi, Sorry if this is OT :( I have some old CSS files that have all class names preceded with tagname, like "TD.verysmall" or "span.important". I'm exeprimenting with Dreamwiever and I noticed that, when making new class, DW doesn't ask me for which tag it is. I also noticed that classes in some template css files don't have tagnames in front.
1
5669
by: Peter King | last post by:
if you assign multiple classes in order to keep your classes generic e.g ..classA { position.absolute; left:5 top:5 height:200 width:800 } ..classB { background-color: red} ..classC { background-color: green} <div id="div1" class="classA classB" ... but then want to dynamically assign a new class
8
2040
by: Calan | last post by:
I have a server-side ASP script that dynamically creates an input form from a database table. The table contains a field name, the table where values are stored, type of input control, value for a label, etc. What I need to do is create a JS validation routine that will check each control for valid input, regardless of what the control name is. If it is a "select", it needs to verify the index is > 1. If it is an "input", it needs to...
5
2447
by: Dani | last post by:
Hello everybody, I have some code that disables form elements on body load, but I notice when I hit the "back" button, I need to re-enable the form elements (that is done by clicking on a radial button). Is there any way I can keep the form for disabling every time a user hits the back button and "remember" what elements should be enabled? I was thinking maybe utilizing some referrer thing, but I'm not that good with JS yet. Thanks...
4
3410
by: Andy Sutorius | last post by:
Hi, I have a folder with a web.config file using forms authentication thus requiring that folder to be an IIS application. When I attempt to visit a webpage in that folder, default.aspx, I receive the error: could not load type "namespace.classname" I found MS KB #306155 and followed the recommended steps of performing a build on the web project. I am still receiving the error. I thought I had this problem solved in a previous post...
0
1376
by: jceddy | last post by:
Hi...I hope I am posting this in an appropriate place...if not, could some direct me to someplace better? Anyway, the problem I have is that I have a page with a table with two rows. The top row of the table holds some stylesheet-controlled buttons, and the bottom row contains an IFRAME which loads a framed page. The problem is that whenever I mouseover a button in the top row of the table, one of the frames in the bottom row is...
4
1966
by: bill tie | last post by:
I'm trying to re-construct missing classes in somebody else's code. Salient points: Dictionary<string, Projectprojects = new Dictionary<string, Project>(); .... WeeklyAggregation aggregation = new WeeklyAggregation(); .... aggregation.Project = new Project; <-------- What is this? projects.Values.CopyTo(aggregation.Project, 0);
5
11154
by: garfy | last post by:
Hi i get this error in validation Line 22 column 6: document type does not allow element "title" here. <title>Seo Web Design Los Angeles - Web Design And Search Engine Optimization L But the title is inside the head so why I am getting this?
9
2774
by: =?Utf-8?B?QWJoaQ==?= | last post by:
i was looking in some code in which i found that it is using @ keyword before class name and constructor like this public class @MyClass { public @MyClass { } }
0
9646
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10795
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10512
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10550
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6957
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3981
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3083
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.