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

Refering to web page class from another class

In 1.1 it was possible to refer to a web page class from another class

I've just started in v2.0 and found that this code sn't working

The web page class:

Partial Class _Default

Inherits System.Web.UI.Page

End Class

The class that want to refer to this:

Public Class Class1

Private _def As _Default

End Class

The _def variable wont compile as _Default is not defined.

Is there a directive I'm missing?

Feb 8 '06 #1
1 1414
This is made more difficult in 2.0 :(

The only way I know around it at this point is to place an interface for
your default class in app_code and reference the interface rather then the
class.

public interface IDefault
public property Name as string
end interface

partial class _Default
inherits Page
Implements IDefault

public property name as string
get ..
set..
end property
end class

public Class Class1
private _def as IDefault
....
end class.

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Nick Zdunic" <Ni********@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
In 1.1 it was possible to refer to a web page class from another class

I've just started in v2.0 and found that this code sn't working

The web page class:

Partial Class _Default

Inherits System.Web.UI.Page

End Class

The class that want to refer to this:

Public Class Class1

Private _def As _Default

End Class

The _def variable wont compile as _Default is not defined.

Is there a directive I'm missing?

Feb 8 '06 #2

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

Similar topics

5
by: Rajan Moorjaney | last post by:
Hello, I know that I can get the refering URL using Request.ServerVariables("HTTP_REFERER") but how can I get the URL if the page no longer exists and so is being redirected to '404 File not...
5
by: Rick | last post by:
Hi, Another question for today, it's about structs refering to each other. I tried this code struct List; struct child { struct List parent; };
3
by: Nick Zdunic | last post by:
Just loaded up ASP.Net 2.0 and found that I can't refer to a specific web page class from another class. For example: Partial Public Class _Default Inherits System.Web.UI.Page End Class
3
by: Ross Holder | last post by:
I've created a number of business entities for an applciation I'm working on in ASP.NET (Framework 1.1) and would like to quickly get data into a BoundColumn for a control that consums a...
4
by: JJ | last post by:
My master page contains various graphics that are referenced from the images folder. As long as the container pages are at the same level (ie. the top level looking at the solution explorer in...
5
by: Alex Maghen | last post by:
I frequently find myself wanting to insert some basic client-side JavaScript functions in the page of an ASPX of mine. But I find it so frustrating that I have to actually contruct my JavaScript in...
21
by: glenn | last post by:
hi - Im quite new to python, wondering if anyone can help me understand something about inheritance here. In this trivial example, how could I modify the voice method of 'dog' to call the base...
1
by: Sarwan | last post by:
Hello everybody I have a solution in which there is an unmanaged MFC application. Then i added a new managed .Net Windows Form application. I was trying to refer an header file of unmanaged...
3
by: kalpana84 | last post by:
hi, Am doing coding in c#,... actually i am creating four different classes in four different . And all classes has the same namespace. What to be done If i want invoke the method of one class...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...
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...

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.