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. Advertising

  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. 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. Allan Ebdrup
    Replies:
    11
    Views:
    658
    Walter Wang [MSFT]
    Jul 26, 2007
  2. J.Marsch

    Persisting Design-time generated value

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

    Properties not persisting at design time.

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

    Persisting control properties at design time

    cpnet, Apr 19, 2004, in forum: ASP .Net Building Controls
    Replies:
    15
    Views:
    281
    Jeffrey Tan[MSFT]
    May 10, 2004
  5. 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:
    116
    jebecker@_NO_SPAM_.pointroll.com
    Jul 14, 2006
Loading...

Share This Page