473,789 Members | 2,898 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp.net 2.0 creating a base page

Hi all,In asp.net 1.x i creates a basepage that extends
System.Web.UI.P age class.
I created this file in a web appplcaition project and then refernced it
from another projects.
All the pages in this project inherited from this new BasePage ionstead
of the Page class.

In asp.net 2.0 i dont seem to make this work.
I did the same thing. precompile the project and then added refernce to
the assemblies in the precompiled directory.

It doesnt seem to work since i put a break point at the Page_Load event
and others in the base class and it doesnt seem to reach there.

What shoul i do?

by the way if i put the basepage in the App_Code direcotry - it doent
evenrecognice this base class.(No namespace problem)

anyone?

Sep 12 '06 #1
3 1925
Pini,

In .NET 2.0 there is an easier way to get the same functionality. You can
create a master page. Then use that master page for each new page. In the
new page's html code view you can then add a Master Type directive which
will then let you use any code from the master page.

Here's a how-to:
http://odetocode.com/Blogs/scott/arc...7/16/1944.aspx

Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Pini" <ia*********@ya hoo.comwrote in message
news:11******** **************@ p79g2000cwp.goo glegroups.com.. .
Hi all,In asp.net 1.x i creates a basepage that extends
System.Web.UI.P age class.
I created this file in a web appplcaition project and then refernced it
from another projects.
All the pages in this project inherited from this new BasePage ionstead
of the Page class.

In asp.net 2.0 i dont seem to make this work.
I did the same thing. precompile the project and then added refernce to
the assemblies in the precompiled directory.

It doesnt seem to work since i put a break point at the Page_Load event
and others in the base class and it doesnt seem to reach there.

What shoul i do?

by the way if i put the basepage in the App_Code direcotry - it doent
evenrecognice this base class.(No namespace problem)

anyone?

Sep 12 '06 #2
Hi there Justin and thanks for your reply.
First of all i do know about master pages, bus i dont think they are a
subtitued for Page inheritance.All they do is provide a template and
the same look and feel in all of the pages, please correct me if i am
wrong.

I want to find a way to give all my pages some functionality and not
just the same look and feel.

Is there a way to do this in asp.net.2.0 ?

Do you mean master pages replaces the inheritance "trick"?

S. Justin Gengo כתב:
Pini,

In .NET 2.0 there is an easier way to get the same functionality. You can
create a master page. Then use that master page for each new page. In the
new page's html code view you can then add a Master Type directive which
will then let you use any code from the master page.

Here's a how-to:
http://odetocode.com/Blogs/scott/arc...7/16/1944.aspx

Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Pini" <ia*********@ya hoo.comwrote in message
news:11******** **************@ p79g2000cwp.goo glegroups.com.. .
Hi all,In asp.net 1.x i creates a basepage that extends
System.Web.UI.P age class.
I created this file in a web appplcaition project and then refernced it
from another projects.
All the pages in this project inherited from this new BasePage ionstead
of the Page class.

In asp.net 2.0 i dont seem to make this work.
I did the same thing. precompile the project and then added refernce to
the assemblies in the precompiled directory.

It doesnt seem to work since i put a break point at the Page_Load event
and others in the base class and it doesnt seem to reach there.

What shoul i do?

by the way if i put the basepage in the App_Code direcotry - it doent
evenrecognice this base class.(No namespace problem)

anyone?
Sep 13 '06 #3
Pini,

Yes, master pages can be used the way you want. No, I don't think they are a
complete substitute for page inheritance, but they get very very close.

If you put this line in the source code view of the .aspx template file:

<%@ MasterType VirtualPath="~/MasterPage.mast er" %>

You will then have access to any method you've placed into the master page's
code behind. For example if you place a subroutine for logging exceptions
that takes a string description and the exception itself as parameters on
your master page, you could then call it from your template like this:

Call Master.ProcessE xception("There was an error on page load:", ex)

Thus giving you the same access to common functionality that page
inheritance would have given you.

Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Pini" <ia*********@ya hoo.comwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.com.. .
Hi there Justin and thanks for your reply.
First of all i do know about master pages, bus i dont think they are a
subtitued for Page inheritance.All they do is provide a template and
the same look and feel in all of the pages, please correct me if i am
wrong.

I want to find a way to give all my pages some functionality and not
just the same look and feel.

Is there a way to do this in asp.net.2.0 ?

Do you mean master pages replaces the inheritance "trick"?

S. Justin Gengo ???:
Pini,

In .NET 2.0 there is an easier way to get the same functionality. You can
create a master page. Then use that master page for each new page. In the
new page's html code view you can then add a Master Type directive which
will then let you use any code from the master page.

Here's a how-to:
http://odetocode.com/Blogs/scott/arc...7/16/1944.aspx

Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Pini" <ia*********@ya hoo.comwrote in message
news:11******** **************@ p79g2000cwp.goo glegroups.com.. .
Hi all,In asp.net 1.x i creates a basepage that extends
System.Web.UI.P age class.
I created this file in a web appplcaition project and then refernced it
from another projects.
All the pages in this project inherited from this new BasePage ionstead
of the Page class.

In asp.net 2.0 i dont seem to make this work.
I did the same thing. precompile the project and then added refernce to
the assemblies in the precompiled directory.

It doesnt seem to work since i put a break point at the Page_Load event
and others in the base class and it doesnt seem to reach there.

What shoul i do?

by the way if i put the basepage in the App_Code direcotry - it doent
evenrecognice this base class.(No namespace problem)

anyone?

Sep 15 '06 #4

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

Similar topics

3
1874
by: Ken Varn | last post by:
I am just starting the process of creating ASP.NET server controls. I have created controls for .NET applications, but have just started with ASP.NET. I am a little confused about some areas that I am hoping someone can help clear up. 1. What is the difference between initializing a control in the constructor, vs the OnInit(), vs the CreateChildControls() methods? 2. The control that I created contains an Items collection attribute...
2
1640
by: jen_designs | last post by:
I am trying to create a template in dot net. All the articles I have read on the net are rather confusing. I need a simple solution to create a header and a footer on each page. Can someone point me into the right direction. I started off creating a file template.cs: using System; using System.Web; using System.Web.UI;
8
1120
by: Stephen Adam | last post by:
Hi there, I am developing a web site with a number of pages, I want each page to have the same heading section which will include both the raw html and vb.net code which handle rollovers for some images which will also be included. My initial feeling on how to do this would be to create a base class web page and then inherit it with all the HTML response.writing and image rollover code already there. Problem being that my page already...
12
3176
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without restarting the application. What I did was to create an AppDomain that loaded the plugins and everything was great, until I tried to pass something else that strings between the domains...
3
4147
by: Tabi | last post by:
Hi, I have just created a class that removes action attribute from HtmlForm. The code looks like here. namespace ComIT.Applications.Common { public class Form : System.Web.UI.HtmlControls.HtmlForm { protected override void RenderAttributes(HtmlTextWriter writer)
15
2837
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. Everything is the default settings I believe. IIS is running under Local System. In IIS the DefaultAppPool is running under Network Service. Annonymous access uses the account IUSR_JASMINE (machine name is Jasmine).
26
5375
by: nyathancha | last post by:
Hi, How Do I create an instance of a derived class from an instance of a base class, essentially wrapping up an existing base class with some additional functionality. The reason I need this is because I am not always able to control/create all the different constructors the base class has. My problem can be described in code as follows ... /* This is the base class with a whole heap of constructors/functionality*/ public class Animal
5
2215
by: Dan | last post by:
Hi, I use the <asp:CreateUserWizardcontrol for creating memberusers. In that windows, one must provide an emailaddress. My question is: how can an user later change his emailaddress? Thanks Dan
3
4016
by: Allan Ebdrup | last post by:
I get the error "Error creating control: ID property is not specified" when I view my custom web control in design view. I add the control that gives an error in OnInit like this: ----- foreach (WizardStep ws in WizardSteps) { CustomWizardStepHeader header = new CustomWizardStepHeader(); header.ID = "CustomWizardStepHeader"; ws.Controls.AddAt(0, header); }
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10139
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9020
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5418
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.