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

How to have multiple page execute same event code?

I'm new to .NET and I'm still trying to adapt from PHP. Especially when
dealing with includes. I would like a group of pages to all execute the
same Page_Preinit event code. In php I would just include a file but I
can't figure out how to accomplish this is .NET

What I'm trying to do is setup a group of pages that depending on which
subdomain will programmatically use a different masterpage. I'm
assuming I have to set the MasterPageFile in the Page_Preinit event but
I don't want to duplicate the code in each page. I'm I going about this
correctly?

Thanks

Mar 30 '06 #1
1 1043
On Thu, 30 Mar 2006 11:31:43 -0600, <ry******@yahoo.com> wrote:
I'm new to .NET and I'm still trying to adapt from PHP. Especially when
dealing with includes. I would like a group of pages to all execute the
same Page_Preinit event code. In php I would just include a file but I
can't figure out how to accomplish this is .NET

What I'm trying to do is setup a group of pages that depending on which
subdomain will programmatically use a different masterpage. I'm
assuming I have to set the MasterPageFile in the Page_Preinit event but
I don't want to duplicate the code in each page. I'm I going about this
correctly?

Thanks


Create a base page class, put the event code in there, and have all pages
inherit from this class.

--
Craig
Microsoft MVP - ASP/ASP.NET
Mar 31 '06 #2

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

Similar topics

2
by: David Pautler | last post by:
I'm creating a web-based authoring tool where one form encompasses several sections for editing. I'd like each section to have its own reset button, so that use of that button affects only that...
8
by: CSDunn | last post by:
Hello, I have a situation in which I need to address three SQL Server 2000 Stored Procedure parameters in the OnClick event of an Option Group. The Option Group lives on an Access 2000 ADP form. ...
0
by: zoltix | last post by:
Hi, I am beginner in aspx. I would like to intercept all click events on my document. I use this function in javascipt for that document.onmousedown=click;. It works well. But I would...
4
by: usl2222 | last post by:
Hi folks, I appreciate any assistance in the following problem: I have a form with a bunch of dynamic controls on it. All the controls are dynamically generated on a server, including all...
6
by: anoj | last post by:
Hi All i need to prevent multiple logins from the same user at the same time. what is the best way to do this . How can i detect if a user closes the browser window without logging out so tht...
0
by: js | last post by:
I am using the Microsoft.Practices.EnterpriseLibrary and trying to bind all the DropDownList controls on a page by calling the following function at Page_Load event. My attempt is make only one...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
18
by: =?Utf-8?B?TGkgV2VuZw==?= | last post by:
Hi, Is there a way for TreeView to have multiple selections? But I am not talking about its checked boxes. I want a way similar to ListView with MultiSelect = True. So I can use or key and...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
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
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...
0
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,...

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.