Design-time property change on webctl not saved in page

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!
 

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,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top