473,507 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Page properties in the @Page directive

Hi!

I was wondering if it is possible to access page properties in the
page's @Page directive. For example, if I had a property:
Public Property MyProperty ...
Can I set it using something like:
<%@ Page .... MyProperty="True" .... %>
I ask because I really dont want to handle every page's Load event just
to set this property.

Thanks!

Jan 16 '07 #1
3 1056
"Jeff" <je********@gmail.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
I was wondering if it is possible to access page properties in the
page's @Page directive. For example, if I had a property:

Public Property MyProperty ...

Can I set it using something like:

<%@ Page .... MyProperty="True" .... %>
No.
I ask because I really dont want to handle every page's Load event just
to set this property.
I'm not sure that there would be much difference between adding a few
letters to the @Page tag or adding a line of code to Page_Load, but never
mind...

Why not create a page template with the property you require and get all
your other pages to inherit from it...?
Jan 16 '07 #2
Thanks for your response! Why dont I use a template page? I guess I
thought that was overkill for setting one property. That seems like it
will be the cleanest way to approach it without adding repetative code
for each page. You've sold me!

Thanks again!
Mark Rae wrote:
"Jeff" <je********@gmail.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
I was wondering if it is possible to access page properties in the
page's @Page directive. For example, if I had a property:

Public Property MyProperty ...

Can I set it using something like:

<%@ Page .... MyProperty="True" .... %>

No.
I ask because I really dont want to handle every page's Load event just
to set this property.

I'm not sure that there would be much difference between adding a few
letters to the @Page tag or adding a line of code to Page_Load, but never
mind...

Why not create a page template with the property you require and get all
your other pages to inherit from it...?
Jan 17 '07 #3
"Jeff" <je********@gmail.comwrote in message
news:11**********************@l53g2000cwa.googlegr oups.com...
Thanks for your response! Why dont I use a template page? I guess I
thought that was overkill for setting one property. That seems like it
will be the cleanest way to approach it without adding repetative code
for each page. You've sold me!
Welcome to OOP...:-)
Jan 17 '07 #4

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

Similar topics

0
957
by: lester | last post by:
I am using a C++ dll and need to run unsafe code because of pointers. I'm using Visual Studio.NET 2002. Everything I've seen says to go to the project properties, then build properities page and...
0
967
by: lester | last post by:
I'm using a C++ dll and need to allow unsafe code because the dll function takes char *. I am using Visual Studio.NET 2002. Everything I've seen says to go to the project properties page, then the...
1
1671
by: lester | last post by:
I'm using a C++ dll and need to allow unsafe code because the dll function takes char *. I am using Visual Studio.NET 2002. Everything I've seen says to go to the project properties page, then the...
1
1034
by: Angel | last post by:
Is there any way to set custom public properties that i created on the page via JavaScript. I would like to open a Web Dialog Window but while I open the aspx page in that dialog window I'd like to...
5
2756
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
3
2351
by: William Youngman | last post by:
I am on a team that is developing a proposal generation web application and we are using a custom base page (ProGenBase.cs) located in the app_code directory and all of the app's web pages inherit...
4
3986
by: evantay | last post by:
I'm using ASP.NET 2.0 with VS.NET 2005. I'm trying to access properties from my master pages within a page that inherits from that master page (a child page). However the values are always null....
3
2042
by: Francois | last post by:
I plan a master page / content page design for next application. The master page would contain some standard button for my app. For instance a "Save" button. (present on all pages). But how...
4
1430
by: Seth Williams | last post by:
If I have some Master Page properties, and assign them when the master page first loads, knowing that I can access these property values in the current Content pages, will these properties be...
0
7223
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
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7034
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...
0
5623
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,...
0
4702
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...
0
3191
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
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...

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.