473,666 Members | 2,238 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="Tru e" .... %>
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 1058
"Jeff" <je********@gma il.comwrote in message
news:11******** **************@ q2g2000cwa.goog legroups.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="Tru e" .... %>
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********@gma il.comwrote in message
news:11******** **************@ q2g2000cwa.goog legroups.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="Tru e" .... %>

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********@gma il.comwrote in message
news:11******** **************@ l53g2000cwa.goo glegroups.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
961
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 select to allow it. My project does not have a build properties page, only a configuration properties page that doesn't allow me to do anything. Is this because I'm not using the command line compiler, or because this is an ASP.NET webapp? This...
0
972
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 build properties page and allow it there. For some reason, my project does not have a build properties page, only a configuration properties page. Can I add a build properties page somehow? Is this because I am not using the command line...
1
1673
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 build properties page and allow it there. For some reason, my project does not have a build properties page, only a configuration properties page. Can I add a build properties page somehow? Is this because I am not using the command line...
1
1043
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 pass it certain properties(like sql connection string) before it opens that page up. thanks, Angel
5
2774
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 to the database to get the next page. Is there a way to use the dataset to allow us to read back and forth in it instead of going back to the database to get it? Thanks,
3
2359
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 from this custom page. Additionally I have a main menu tab control that is located in a master page and certain tabs are displayed dependant on the users authentication level. I am using boolean properties in the master page to control the visible...
4
4000
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. In my masterpage I have this: private bool m_AlreadyTested; public bool AlreadyTested { get { return m_AlreadyTested; }
3
2045
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 can I call code in the content.cs page from the Save_Click in the master.cs page ? Thanks.
4
1438
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 persisted through every page, until the browser is closed?
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8638
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6191
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
5662
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
4193
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...
0
4365
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
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
2006
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1769
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.