A
atip
Hi!
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.
Thanks!
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.
Thanks!