Page properties in the @Page directive

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

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!
 
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...?
 
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!
 
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...:-)
 
Back
Top