VS2005 How to 'format' a long HTML Attribute

Discussion in 'ASP .Net Building Controls' started by KCS, Mar 4, 2006.

  1. KCS

    KCS Guest

    Hi. I have a vs2005 custom web control. It uses a designer inherited from
    ControlDesigner. The designer writes an XML value as a string property into
    the control which the IDE inserts into the HTML source.

    Example: <myControl MyAttribute="<RootNode><SubNode> ... representing a
    potentially long piece of XML" />

    In vs2003, 'myAttribute' gets automatically split into several lines if it
    is long.

    In vs2005, 'myAttribute' is all on the one line.

    How do I get the html to be spread over multiple lines?

    Example: <myControl MyAttribute="<RootNode>
    <SubNode>
    more XML" />

    I tried using 'GetPersistenceContent' but I think this is only for use when
    the control renders and not when changing property values. Note the attribute
    value is in quotes so you cannot insert crlf's as these get changed into
    escaped values.

    Thanks
     
    KCS, Mar 4, 2006
    #1
    1. Advertising

  2. KCS

    DWS Guest

    KCS,
    Its probably by design ***new in VS2005 right click format source***. This
    wouldn't be a problem unless the format source option did not work correctly
    with the long property value. Also to preserve embedded spaces in properties
    its definately a better practice to keep them on one line.

    Good Luck
    DWS

    PS Please vote for one of my designs "Software" or the "The Hand is Quicker
    Than the Eye" http://blog.mix06.com/contest/gallery/default.aspx
    Thanks DWS


    "KCS" wrote:

    > Hi. I have a vs2005 custom web control. It uses a designer inherited from
    > ControlDesigner. The designer writes an XML value as a string property into
    > the control which the IDE inserts into the HTML source.
    >
    > Example: <myControl MyAttribute="<RootNode><SubNode> ... representing a
    > potentially long piece of XML" />
    >
    > In vs2003, 'myAttribute' gets automatically split into several lines if it
    > is long.
    >
    > In vs2005, 'myAttribute' is all on the one line.
    >
    > How do I get the html to be spread over multiple lines?
    >
    > Example: <myControl MyAttribute="<RootNode>
    > <SubNode>
    > more XML" />
    >
    > I tried using 'GetPersistenceContent' but I think this is only for use when
    > the control renders and not when changing property values. Note the attribute
    > value is in quotes so you cannot insert crlf's as these get changed into
    > escaped values.
    >
    > Thanks
    >
    >
    >
     
    DWS, Mar 7, 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. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    728
    Eric Sosman
    Jul 8, 2003
  2. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,236
    Peter Shaggy Haywood
    Sep 20, 2005
  3. Mathieu Dutour

    long long and long

    Mathieu Dutour, Jul 17, 2007, in forum: C Programming
    Replies:
    4
    Views:
    506
    santosh
    Jul 24, 2007
  4. Bart C

    Use of Long and Long Long

    Bart C, Jan 9, 2008, in forum: C Programming
    Replies:
    27
    Views:
    840
    Peter Nilsson
    Jan 15, 2008
  5. veryhotsausage
    Replies:
    1
    Views:
    1,880
    veryhotsausage
    Jul 4, 2008
Loading...

Share This Page