Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 1st, 2007, 09:15 PM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default page class access

I am trying to access a Page class from another class. For example I have a page:

Page: MyPage.aspx
Code Behind: MyPage.aspx.cs

I have a public static method in MyPage.aspx.cs called "GetName". When I try and reference that method: MyPage.GetName() from another code behind class, intellesense can't find the "MyPage" class, but it will compile and work. When I try to access the same method from the code behind of a master page, it won't even compile. It says it can't find the type "MyPage". All the pages reside in the same directory.

So the question is, how do you access the class of a page from other pages? This works fine using ASP.NET 1.1

-Jon

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
access class object Sheraz Khan ASP.NET 2.0 Professional 0 September 10th, 2007 06:19 PM
How to Reference a Page in an External Class Aaron Edwards ASP.NET 2.0 Basics 0 March 12th, 2007 01:18 AM
Property access from Class within Partial Class zoltac007 C# 2005 0 December 1st, 2006 01:01 AM
Page 58 - Class or Classlibrary? stuckish BOOK: ASP.NET Website Programming Problem-Design-Solution 1 February 8th, 2004 09:01 AM
Access to a property in the class. AyatKh ASP.NET 1.0 and 1.1 Basics 2 December 18th, 2003 11:25 AM



All times are GMT -4. The time now is 06:01 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.