Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Design-time property change on webctl not saved in page

Thread Tools

Design-time property change on webctl not saved in page

Posts: n/a

I have a WebControl with 2 properties. In the properties window I change
one of them. Internally I would like to set another property to a default
value. When I do this, the first property (the one changed in the properties
window) gets changed and updates the HTML in the page, but the one changed
internally is not saved.

Here's the code:

public class myControl: System.Web.UI.WebControls.Button {
private string _one, _two;

public myControl() : base()
{ /*_*/ }

public string one {
get { return _one; }
set { this.two = value + " and Two!"; _one = value; } }
public string two {
get { return _two; }
set { _two = value; } }

If I set "one" in the Properties Window to a value, "two" should be set to
whatever the value of "one" was + " and Two!".
But although property "two" is changed in the properties window, the changes
do not appear in the HTML of the page.


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting the value of a Master page's control's property using a property of the Master page Nathan Sokalski ASP .Net 25 03-04-2010 03:42 AM
How could I change the NavigateUrl property at runtime based on another controls property ? Radu ASP .Net 2 01-25-2007 10:51 AM
Saved Mail Gone and Sent Mail Not Being Saved Gregg Firefox 6 03-06-2006 02:13 AM
Design-time property change on webctl not saved atip ASP .Net Building Controls 1 02-06-2005 02:29 AM
Property Not saved in Composite Control... Help & Pointers required. Namshub ASP .Net Building Controls 1 01-26-2005 09:04 PM