ShouldSerialize and method in WebControl

Discussion in 'ASP .Net Building Controls' started by Victor Irzak, Sep 20, 2004.

  1. Victor Irzak

    Victor Irzak Guest

    Hello,

    Why doesn't ShouldSerialise Method work in WebControl?
    What is the best way to control the which attributes are serialized and
    which once aren't
    DefaultValue attribute in not enough.

    Thanks

    Victor
     
    Victor Irzak, Sep 20, 2004
    #1
    1. Advertising

  2. "Victor Irzak" <> wrote in message
    news:...
    > Hello,
    >
    > Why doesn't ShouldSerialise Method work in WebControl?
    > What is the best way to control the which attributes are serialized and
    > which once aren't
    > DefaultValue attribute in not enough.


    How about
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]?
    --
    John Saunders
    johnwsaundersiii at hotmail
     
    John Saunders, Sep 21, 2004
    #2
    1. Advertising

  3. Victor Irzak

    Victor Irzak Guest

    That's not enough either.

    I'd like to decide whether to serialize an attribute based on other members
    of the class.
    DesignerSerializationVisibility and DefaultValue can't do that while
    ShouldSerialize does, but works only with winforms.




    "John Saunders" <> wrote in message
    news:%...
    > "Victor Irzak" <> wrote in message
    > news:...
    > > Hello,
    > >
    > > Why doesn't ShouldSerialise Method work in WebControl?
    > > What is the best way to control the which attributes are serialized and
    > > which once aren't
    > > DefaultValue attribute in not enough.

    >
    > How about
    > [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]?
    > --
    > John Saunders
    > johnwsaundersiii at hotmail
    >
    >
     
    Victor Irzak, Sep 21, 2004
    #3
  4. Victor Irzak

    WALDO Guest

    ShouldSerialize works

    [VB.Net]

    Private _myProperty As String = "[Default Value]"
    Public Property MyProperty As String
    Get
    Return Me._myProperty
    End Get
    Set(Value As String)
    Me._myProperty = Value
    End Set
    End Property

    Private Function ShouldSerializeMyProperty As Boolean
    Return CBool(Me._myProperty <> "[Default Value]")
    End Function


    "Victor Irzak" <> wrote in message news:<#I34tx#>...
    > That's not enough either.
    >
    > I'd like to decide whether to serialize an attribute based on other members
    > of the class.
    > DesignerSerializationVisibility and DefaultValue can't do that while
    > ShouldSerialize does, but works only with winforms.
    >
    >
    >
    >
    > "John Saunders" <> wrote in message
    > news:%...
    > > "Victor Irzak" <> wrote in message
    > > news:...
    > > > Hello,
    > > >
    > > > Why doesn't ShouldSerialise Method work in WebControl?
    > > > What is the best way to control the which attributes are serialized and
    > > > which once aren't
    > > > DefaultValue attribute in not enough.

    > >
    > > How about
    > > [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]?
    > > --
    > > John Saunders
    > > johnwsaundersiii at hotmail
    > >
    > >
     
    WALDO, Oct 20, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    2
    Views:
    744
  2. Luis Ramírez.

    Can a webcontrol (webcontrol.dll) have a configuration file?

    Luis Ramírez., Jul 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    210
    Luis Ramírez
    Jul 6, 2004
  3. Kasabaarde Sumta

    WebControl inside of WebControl and attaching events

    Kasabaarde Sumta, Dec 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    204
    Kasabaarde Sumta
    Dec 13, 2004
  4. Fabricio

    Custom webcontrol that references another webcontrol

    Fabricio, Sep 21, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    192
    Fabricio
    Sep 21, 2005
  5. Victor Irzak

    ShouldSerialize and method in WebControl

    Victor Irzak, Sep 20, 2004, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    158
    WALDO
    Oct 20, 2004
Loading...

Share This Page