How to set the page property in aspx file?

G

Guest

Hi there, I thought this is easy but end up coming here for help. Here is my
problem-- My page class has several properties, like security, title... What
I want to do is instead of set the property in the code behind, I want to set
them in aspx page in a HTML syntax.

I know control can do this. -- when you drop a control on the page, you can
specify the properties within the <mycontrol...> tag.

This case become more real when I start to use PageBase implementation.
Hopefully you can share some lights here. Thanks.
 
G

Guest

I found a partial answer from Mr. ScottGu's blog. --"Obscure but cool feature
in ASP.NET 2.0 " . He said you can add additional property in @page
directive. But here is the catch I found :

1. VS 2005 always complains the aspx syntax error
2. You have to change "inherits" in @page tag to point to base class and
remove the codefile property

Obviously, asp.net engine can only check either the first page class or the
most basic Page class in the inheritance tree to find the property, but not
the one in the middles. So if you have your own PageBase, then you are
toasted.

Then I start to wonder when the next version of asp.net will be?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top