Property is loosing value

Discussion in 'ASP .Net Building Controls' started by MBO, Jul 28, 2005.

  1. MBO

    MBO Guest

    Hello NG,

    I've created a custom component inherited from
    "System.Web.UI.Webcontrold.Button" and added a new String Property

    ....

    Private _waitMessage As String

    <Bindable(True), Category("Appearance"), DefaultValue("Please Wait")> Public
    Property [WaitMessage]() As String

    Get
    Return _waitMessage
    End Get
    Set(ByVal Value As String)
    _waitMessage = Value
    End Set
    End Property

    ....

    If I'm using the component, I can set the property in the property editor,
    but when I built the project it is set back to an empty string. I found out
    that when I add the component the following code is added to the webform:

    ....

    <cc1:pleaseWaitButton id="PleaseWaitButton1" style="Z-INDEX: 101; LEFT:
    392px; POSITION: absolute; TOP: 208px"
    runat="server" Text="Search" Width="440px"
    Height="128px"></cc1:pleaseWaitButton>

    ....

    It seems that the "WaitMessage" attribute is missing, if I manually add the
    attribute like


    <cc1:pleaseWaitButton id="PleaseWaitButton1" style="Z-INDEX: 101; LEFT:
    392px; POSITION: absolute; TOP: 208px"
    runat="server" Text="Search" WaitMessage="Please Wait" Width="440px"
    Height="128px"></cc1:pleaseWaitButton>

    ....

    the probelm is solved, the property holds its value also when I build the
    project.

    What do I need to change in the property or component, that the
    "WaitMessage" attribute is inserted automatically when I insert the
    component to a webform ?

    Thanks and Regards

    MBO
    MBO, Jul 28, 2005
    #1
    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. MBO
    Replies:
    0
    Views:
    302
  2. CreativeMind

    loosing a session value

    CreativeMind, Apr 2, 2009, in forum: ASP .Net
    Replies:
    3
    Views:
    418
    CreativeMind
    Apr 3, 2009
  3. Mark Norgate

    Loosing property values; and design time rendering

    Mark Norgate, Aug 24, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    113
    Mark Norgate
    Aug 24, 2003
  4. MBO

    Property is loosing value

    MBO, Jul 28, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    121
    Teemu Keiski
    Jul 29, 2005
  5. JohnnyW
    Replies:
    6
    Views:
    139
    Dr John Stockton
    Mar 18, 2006
Loading...

Share This Page