Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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
 
Old July 7th, 2003, 10:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page reference in cs file


I am pretty new to this ASP .NET thing, so I feel quite amputated. Nonetheless I think I have read that you can make a page reference in the C# code.

I have got an .aspx page which includes this line...

Code:
<%@ Page Language="C#" Debug="true" Inherits="OCMS" src="source/OCMScore.cs" %>
Then I have got a C# file with the following contents...

Code:
using System;
using System.Web;
using System.Web.UI;

using OCMSsetup;

public class OCMS : Page
{
    public void Page_Load(Object oSender, EventArgs E)
    {
        Configuration config = new Configuration();
        config.Write();
    }
}
Finally I WOULD LIKE to have a file like this...

Code:
namespace OCMSsetup
{
    public class Configuration
    {
        public Configuration()
        {            
        }

        public void Write()
        {
            Response.Write("something");
        }

    }
}
That is, I would like to be able to use the Page object from everywhere!

Is this possible and if 'yes' how?

Thanks

Jacob.
__________________
Danish audio books for download at http://www.lytenbog.dk (Danske lydbøger til download).
 
Old July 22nd, 2003, 10:37 PM
Authorized User
 
Join Date: Jun 2003
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to planeswalk
Default

Hi,

Yes, this is possible, although you will have to compile your custom Namespace into a DLL and place it in a /bin folder under your application root.


Cheers!
Marlon





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 7 Object reference error in master.cs mikeal_a BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 September 5th, 2008 07:19 AM
Add textbox in cs file khorshid_sh ASP.NET 1.0 and 1.1 Basics 2 April 30th, 2008 02:37 PM
how to call .cs file into another application ravi_bachwala ASP.NET 1.0 and 1.1 Basics 0 June 19th, 2007 07:30 AM
Master Page File Reference bandrsolutions ASP.NET 2.0 Basics 2 February 7th, 2007 12:26 PM
SQL in .cs file the_dude ADO.NET 2 January 27th, 2007 04:37 AM





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