|
|
|
start date: Mon, 30 Jul 2007 16:59:06 -0700,
posted on: microsoft.public.dotnet.framework.aspnet.webcontrols
back
| Thread Index |
|
1
unknown
|
|
2
Scott M. am
|
|
3
marss
|
|
4
marss
|
|
5
unknown
|
Enum Property
I have an enum property in web control. I can set it to One, Five,
Fifteen. It always returns "One" at runtime. Any suggestion.
public enum Interval
{
One,
Five,
Fifteen
}
[Bindable(true),
Category("Appearance"),
Description("Sets Minute Interval. Permissible values are One,
Five, Fifteen"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
PersistenceMode(PersistenceMode.Attribute)]
public virtual Interval MinuteInterval
{
get
{
object result = this.ViewState["MinuteInterval"];
if (result != null)
return (Interval)result;
else
return Interval.One;
}
set
{
ViewState["MinuteInterval"] = value;
}
}
Date:Mon, 30 Jul 2007 16:59:06 -0700
Author:
|
Re: Enum Property
It looks to me like ViewState["MinuteInterval"] is not getting a value in
the first place, causing you to always return "one". Why not try using your
enum with a simple property first and then move on to ViewState values?
wrote in message
news:1185839946.416213.189020@z28g2000prd.googlegroups.com...
>I have an enum property in web control. I can set it to One, Five,
> Fifteen. It always returns "One" at runtime. Any suggestion.
>
> public enum Interval
> {
> One,
> Five,
> Fifteen
> }
>
> [Bindable(true),
> Category("Appearance"),
> Description("Sets Minute Interval. Permissible values are One,
> Five, Fifteen"),
> DefaultValue(""),
>
> DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
> PersistenceMode(PersistenceMode.Attribute)]
> public virtual Interval MinuteInterval
> {
> get
> {
> object result = this.ViewState["MinuteInterval"];
> if (result != null)
> return (Interval)result;
> else
> return Interval.One;
> }
> set
> {
> ViewState["MinuteInterval"] = value;
> }
> }
>
Date:Tue, 31 Jul 2007 01:03:49 -0400
Author:
|
Re: Enum Property
On 31 , 02:59, brandonjack...@gmail.com wrote:
> [Bindable(true),
> Category("Appearance"),
> Description("Sets Minute Interval. Permissible values are One,
> Five, Fifteen"),
> DefaultValue(""),
>
> DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
> PersistenceMode(PersistenceMode.Attribute)]
> public virtual Interval MinuteInterval
> {
Remove
DesignerSerializationVisibility(DesignerSerializationVisibility.Content).
Default value for this attribute is Visible - it has to used set in
your case.
Regards,
Mykola
http://marss.co.ua
Date:Tue, 31 Jul 2007 03:00:27 -0700
Author:
|
Re: Enum Property
On 31 , 13:00, marss wrote:
> it has to used set in your case.
it has to be used in your case.
Date:Tue, 31 Jul 2007 03:28:45 -0700
Author:
|
Re: Enum Property
Removing
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)
fix the isssue.
Thanks
Date:Tue, 31 Jul 2007 09:11:26 -0700
Author:
|
|
|