Problem persisting asp.net 2.0 property in design-time

Discussion in 'ASP .Net Building Controls' started by JesperA, Oct 17, 2006.

  1. JesperA

    JesperA Guest

    Hi!

    I have a asp.net 2.0 webcontrol with a property called TestProp (type:
    string), if i change value in the property-window in vs.net manually
    everything works fine. The value is persisted to the HTML-source.
    But if I connect a designer and change the value in code (opening the
    desigen from design-mode in vs.net), the value looks changed in the
    property-window but it is NOT persisted to the HTML-source.

    What am I doing wrong! I have tried everyting....

    /Jesper
     
    JesperA, Oct 17, 2006
    #1
    1. Advertisements

  2. Jesper,

    You will want to have the designer save the values you set in the
    Properties window and then set the values in the controls as you want
    to see them in Design Mode, and then restore the saved values.

    You can see an example of this in a control I created...

    http://svn.offwhite.net/svn/SmallSh...k/ClassLibrary/Web/UI/Controls/ContactForm.cs

    Look for the GetDesignTimeHtml method near the bottom.

    Brennan Stehling
    http://brennan.offwhite.net/blog/

    JesperA wrote:
    > Hi!
    >
    > I have a asp.net 2.0 webcontrol with a property called TestProp (type:
    > string), if i change value in the property-window in vs.net manually
    > everything works fine. The value is persisted to the HTML-source.
    > But if I connect a designer and change the value in code (opening the
    > desigen from design-mode in vs.net), the value looks changed in the
    > property-window but it is NOT persisted to the HTML-source.
    >
    > What am I doing wrong! I have tried everyting....
    >
    > /Jesper
     
    Brennan Stehling, Oct 18, 2006
    #2
    1. Advertisements

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. flamesrock
    Replies:
    8
    Views:
    806
    Hendrik van Rooyen
    Nov 24, 2006
  2. Allan Ebdrup
    Replies:
    11
    Views:
    834
    Walter Wang [MSFT]
    Jul 26, 2007
  3. J.Marsch

    Persisting Design-time generated value

    J.Marsch, Oct 7, 2003, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    198
    Mike Clay
    Oct 13, 2003
  4. Steve Barker

    Properties not persisting at design time.

    Steve Barker, Jan 22, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    241
    Steve Barker
    Jan 22, 2004
  5. cpnet

    Persisting control properties at design time

    cpnet, Apr 19, 2004, in forum: ASP .Net Building Controls
    Replies:
    15
    Views:
    431
    Jeffrey Tan[MSFT]
    May 10, 2004
  6. Ryan Taylor

    using the Items property in the design time property window

    Ryan Taylor, Feb 8, 2005, in forum: ASP .Net Building Controls
    Replies:
    4
    Views:
    700
    Paul Louth
    Feb 18, 2005
  7. jebecker@_NO_SPAM_.pointroll.com

    Issues Persisting Design time changes to page source

    jebecker@_NO_SPAM_.pointroll.com, Jul 13, 2006, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    206
    jebecker@_NO_SPAM_.pointroll.com
    Jul 14, 2006
  8. Rob R. Ainscough

    VS.NET 2003 using ASP.NET & VB.NET -- IDE design time problems?

    Rob R. Ainscough, May 5, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    336
    Rob R. Ainscough
    May 6, 2005
Loading...