473,396 Members | 1,989 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.

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 connectionString 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 connectionString property in the GlobalPage
from my ascx control. This is what I wrote :

this.connectionString = ((Web.GlobalPage)this.Page.Master).ConnectionStrin g;

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

"An exception of type 'System.InvalidCastException' occurred in
App_Web_zjl86e8a.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="GlobalPage.master.cs" Inherits="Web.GlobalPage"

ClassName="GlobalPage" %>

Ascx Control

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SideBar.ascx.cs"
Inherits="Web.SideBar" ClassName="SideBar"%>

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

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

Similar topics

3
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...
1
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 {...
8
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...
5
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...
4
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...
0
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...
4
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...
5
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 ...
9
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.