473,386 Members | 1,721 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,386 software developers and data experts.

Set Custom Page properties declaratively


Hi,

I have a base class (which inherits from System.Web.UI.Page) for all the
pages in my application. I have a property defined on this class that I want
to set declaratively in the .aspx (i.e., not in the .aspx.cs) file.

Is there any way to do this declaratively? When I try to use the <@ Page
....> directive, it only allows the predefined attributes to be used.

Thanks,

Richard Brown
Dec 2 '05 #1
2 1236
<script language="CSharp" runat="server">
// put your code in here
</script>

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a horse to water,
but you can't make him think.

"Richard Brown" <Richard Br***@discussions.microsoft.com> wrote in message
news:70**********************************@microsof t.com...

Hi,

I have a base class (which inherits from System.Web.UI.Page) for all the
pages in my application. I have a property defined on this class that I
want
to set declaratively in the .aspx (i.e., not in the .aspx.cs) file.

Is there any way to do this declaratively? When I try to use the <@ Page
...> directive, it only allows the predefined attributes to be used.

Thanks,

Richard Brown

Dec 2 '05 #2

Thanks for replying so quickly. Unfortunately the example you have provided
does not meet my requirements on two counts:

1. This is not declarative. This is code, and I would add this to the
code-behind class.

2. The <script> tags allow the client to define functions, but not run code.

If the code requires to be run it needs the old-style <% %> breakout.
However this code is then run during the rendering of the page, which is
invoked from the .Net Framework (i.e,. the client does not have control over
when this code is executed).

I was wondering if there is a way of declaratively setting the properties of
the page class before the OnInit (in much the same way that properties are
set in a server control).

Thanks,

Richard Brown

"Kevin Spencer" wrote:
<script language="CSharp" runat="server">
// put your code in here
</script>

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a horse to water,
but you can't make him think.

"Richard Brown" <Richard Br***@discussions.microsoft.com> wrote in message
news:70**********************************@microsof t.com...

Hi,

I have a base class (which inherits from System.Web.UI.Page) for all the
pages in my application. I have a property defined on this class that I
want
to set declaratively in the .aspx (i.e., not in the .aspx.cs) file.

Is there any way to do this declaratively? When I try to use the <@ Page
...> directive, it only allows the predefined attributes to be used.

Thanks,

Richard Brown


Dec 2 '05 #3

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

Similar topics

1
by: Eldon Ferran de Pol | last post by:
Hi all I've got a custom control that has several image based properties I wan't each of these properties to use the standard .Net dialog box for selecting a URL that appears when setting the...
1
by: Eldon Ferran de Pol | last post by:
Hi all I've got a custom control that has several image based properties I wan't each of these properties to use the standard .Net dialog box for selecting a URL that appears when setting the...
7
by: Jed | last post by:
I have a web service method that returns an array of custom objects marked serializeable with fully described public properties. When I bind the results to a DataGrid I can access the properties...
9
by: Jaybuffet | last post by:
my aspx has something like this <asp:Repeater id="Repeater1" runat="server"> <ItemTemplate> <mycontrol:ctl id="ctlId" obj='<%# Container.DataItem %>' showItem="true"/> </ItemTemplate>...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
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...

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.