DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
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:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us