Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

page inheritance

Status
Not open for further replies.

raghu3

Programmer
Dec 19, 2005
96
US
With reference th the following thread:
thread855-1049521
I am basically hitting a wall to have a base page as a common repository for a set of functions:
maybe I will have 2 user controls: header and footer.
Rest will be just c# functions and some business logic, set-reset session variables.

Can never get to tun the aspx. How does this work. Here is my agony:

basePage.cs
namespace library.Includes
{
public class basePage : System.Web.UI.Page
{
public basePage()
{
//
// TODO: Add constructor logic here
//
}


public string hostServer()
{
return Request.ServerVariables["HTTP_HOST"];
}

public string webAppsPath()
{
return Request.ServerVariables["PATH_INFO"];
}



}
}


My aspx.cs is:
public class _default:library.Includes.basePage

In the Page_Load class, I can see hostServer() ... etc

But on the browser I always get: missing reference to the library.
I am to a point where I am doing trial and error.
I need to do exactly as in the above thread and am stuck!
Please help ...



 
which version of .NET are u working in???

Known is handfull, Unknown is worldfull
 
asp.net 1.1 with visual studio 2003.
Cannot migrate to .net 2.0 as the web servers etc have to migrate, these have a variety of 3rd party apps.

I am so lost,
 
hmm, well, i just wanted to know if u have compiled the file atleast once as the namespace will exist to other files only after the first compile.

other than tat, i am unable to make any other errors in ur code dude...

Known is handfull, Unknown is worldfull
 
I did not compile: Honestly in my previous .net apps, I did not compile. I understood this as the apps will compile on 1st time use. Will try to compile before checking on the browser.

Thanks a lot vbkris: will update the status.
 
sure...

Known is handfull, Unknown is worldfull
 
Lesson learnt.
Works after compiling.
Also have 2 nested web controls: nothing fancy, just headers and footers.
Found out that the following gives error:
Request.ServerVariables["PATH_INFO"];

Replaced with fully qualified ...
HttpContext.Current.Request.ServerVariables["PATH_INFO"];
which works.

-raghu


 
wc dude...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top