473,320 Members | 2,029 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,320 software developers and data experts.

Page level (user defined) properties?

Hi,

Why doesn’t this property work at the Page level after postback;

public virtual string SomePageProperty
{
get
{
string s = (string) ViewState["SomePageProperty"];
return ((s == null) ? String.Empty : s);
}

set
{
ViewState["SomePageProperty"] = value;
}
}
I've used this type of property declaration in custom WebControls before but
cannot see why it would not work at the Page level, seeing as Page inherits
from Control??
Thanks,
May 31 '07 #1
1 1003
OK,

Please ignore this silly question as I was debugging in the OnInit event and
hence ViewState had not been restored!! I must get more sleep!! ;-)
"Mark" wrote:
Hi,

Why doesn’t this property work at the Page level after postback;

public virtual string SomePageProperty
{
get
{
string s = (string) ViewState["SomePageProperty"];
return ((s == null) ? String.Empty : s);
}

set
{
ViewState["SomePageProperty"] = value;
}
}
I've used this type of property declaration in custom WebControls before but
cannot see why it would not work at the Page level, seeing as Page inherits
from Control??
Thanks,
May 31 '07 #2

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

Similar topics

1
by: Jaweed | last post by:
Hi I'm developing an ASP.NET app in Visual studio (using C# for code behind). My question is fairly simple (i think). When I go to the code behind page, the controls in the html page are made...
2
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
6
by: José Joye | last post by:
Hello, I'm currently reading the MS Developing Web applications with c# (and VB.net). In the chapter related to Error management, there is a sample about "Page-Level Error Pages" eg: In my...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
1
by: DJG79 | last post by:
Hi all, I am using an open source menu that i found and it works great, except for one thing that when the web page is not scrolled to the very top the drop down links will not stay visible. Has...
3
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...
0
by: bcanter | last post by:
I found a file on the web that will allow you to enumerate groups but it was an .hta and the top level admins won't allow this. I need to give managers access to the groups so that when a new user is...
4
by: Blasting Cap | last post by:
I have a page that has a number of radio buttons that will be displayed to different access levels of a user who logs in to my website. For instance, if there are a dozen buttons, user1 will see...
5
by: Andreas Prilop | last post by:
Firefox 3 (like older versions) ignores TR { page-break-before: always } for the first row of a TBODY. Sample page: http://www.unics.uni-hannover.de/nhtcapri/temp/1000.html Choose "Print...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.