S
Steve Hershoff
Hi everyone,
I'm not sure that what I'm trying can't be done (at least, not how I'm
trying to do it) but I was hoping for confirmation and possible suggestions
on a future approach.
We have created a specialized version of the DropDownList class. An
abbreviated version reads like this:
public class MyDropDownList: System.Web.UI.WebControls.DropDownList
{
private bool _IsChanged;
....
}
The _IsChanged member is used as a "dirty" flag. Here's an overriden method
that uses it:
protected override void OnSelectedIndexChanged( EventArgs e )
{
_IsChanged = true;
base.OnSelectedIndexChanged(e);
}
If I add my control to an ascx page and give it an autopostback property,
the OnSelectedIndexChanged is fired as expected when the dropdown value
changes.
But modifying the _IsChanged property....does that do any good? After the
page has been reposted I don't believe the member variable's value will be
remembered for future use, even if viewstate has been set on the control.
At least that's how it appears to be in this instance. (I'm using VS 2003
for what it's worth)
If this is the case, would you have any suggestions on how to force a
control to remember internal values between page posts, if possible? Thanks
very much.
I'm not sure that what I'm trying can't be done (at least, not how I'm
trying to do it) but I was hoping for confirmation and possible suggestions
on a future approach.
We have created a specialized version of the DropDownList class. An
abbreviated version reads like this:
public class MyDropDownList: System.Web.UI.WebControls.DropDownList
{
private bool _IsChanged;
....
}
The _IsChanged member is used as a "dirty" flag. Here's an overriden method
that uses it:
protected override void OnSelectedIndexChanged( EventArgs e )
{
_IsChanged = true;
base.OnSelectedIndexChanged(e);
}
If I add my control to an ascx page and give it an autopostback property,
the OnSelectedIndexChanged is fired as expected when the dropdown value
changes.
But modifying the _IsChanged property....does that do any good? After the
page has been reposted I don't believe the member variable's value will be
remembered for future use, even if viewstate has been set on the control.
At least that's how it appears to be in this instance. (I'm using VS 2003
for what it's worth)
If this is the case, would you have any suggestions on how to force a
control to remember internal values between page posts, if possible? Thanks
very much.