Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: HTML in WSI Description

  1. #1
    cc9537 is offline Member
    Join Date
    May 2009
    Posts
    40

    Default HTML in WSI Description

    Greetings,

    I am finding working with WSI more difficult than I had anticipated. I have written a C#.net interface that seems to work for most fields, however I have been unable to correctly upload images or the description. All my images appear to be the same size, I have not figured out how to force them to resize.

    As far as description, here is what is being uploaded.

    <Description>
    <![CDATA[<div class="bullets"> <div class="header"> <h2>DeWALT Power Tools D25223K Features</h2> </div> <ul> <li>8 amp motor provides high performance and overload protection: 01150 RPM 04300 BPM</li> <li>Variable speed trigger allows user to instantly control speed from 0 to dialed setting</li> <li>Delivers 2.5 ft lbs. of Impact Energy providing fast drilling and powerful chipping</li> <li>SHOCKS Active Vibration Control reduces vibration up to 50% while increasing user comfort and productivity</li> <li>Mode selector allows for usage in rotary hammer rotary only and chiseling applications</li> <li>Reversing feature helps release tool from bind up situations and assists with removal of fasteners</li> <li>Integral clutch reduces sudden high torque reactions if bit jams</li> <li>360 degree side handle adjusts easily for preference or use in tight spaces</li> <li>User preferred balance for downward drilling</li> </ul> </div><div class="specswarrleft"> <h2> DeWALT Power Tools D25223K Specifications</h2> <table> <tr> <th align="left">Optimal Concrete Drilling</th> <td>5/32" 5/8""</td> </tr> <tr> <th align="left">Amps</th> <td>8.0Amps</td> </tr> <tr> <th align="left">Impact Energy</th> <td>2.5ftlbs</td> </tr> <tr> <th align="left">No Load Speed</th> <td>01150rpm</td> </tr> <tr> <th align="left">Blows/Min</th> <td>04300bpm</td> </tr> <tr> <th align="left">Chipping</th> <td>Yes</td> </tr> <tr> <th align="left">Clutch</th> <td>Yes</td> </tr> <tr> <th align="left">Wood/Steel Drilling</th> <td>With adaptor"</td> </tr> <tr> <th align="left">Switch</th> <td>VS</td> </tr> <tr> <th align="left">Tool Length</th> <td>17.7"</td> </tr> <tr> <th align="left">Tool Weight</th> <td>7.0lbs</td> </tr> </table> </div><div class="Warranty"><h2>DeWALT Power Tools D25223K Warranty Information</h2> <p>This D<span class="dewaltE">E</span>WALT&reg; High Performance Industrial Tool comes with a warranty package that includes:</p> <ul> <li>90 Day Money Back Guarantee</li> <li>3 Year Limited Warranty</li> <li>2 Year Free Service Contract</li> </ul> <p> <a href="http://www.dewalt.com/WarrantyInformation.aspx" target="_blank">More information on the general D<span class="dewaltE">E</span>WALT warranty</a></p></div><div><a href="http://dewalt.com/AuthorizedDealers.aspxid=1b5944bd1fdd4c1888528eb97 00e52ba" target="_blank"><img src="http://www.nationwidetool.com/images/dewalt_auth.jpg" alt="DeWALT Authorized Retailer Image" border="0"></a></div>]]>
    </Description>
    What I am getting is a description that includes the html, so instead of seeing am unordered list of features I see <ul><li>.....

    any ideas how to get this to populate into the html field, not the text field?


    Thanks.
    Last edited by cc9537; 05-17-2010 at 09:54 AM.

  2. #2
    ZachJ85 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philadelphia, PA
    Posts
    99

    Default

    It's syntax error in the source and how they build the string. Doing research I found it was a bug and they are currently doing a fix to hopefully be released soon.

    If I'm wrong or someone knows how to change it I'd love to hear the fix. I was just unable to find the part in source where they build the string so I can add the missing character.
    SQL 2008, Visual Studio 2010
    Source: C#
    Version: AspDotNetStorefront ML 8.0.1.1/8.0.1.1
    Framework: .Net 4.0 (Running)

  3. #3
    cc9537 is offline Member
    Join Date
    May 2009
    Posts
    40

    Default Resolved

    In an effort to help my fellow ASPDNSFers, I will admit to my idiotic mistake, in case some others find themselves in the same boat.

    In the c# interface I built my description using a string and then output it as an XMLText to an XMLElement. I then concatenated text literally "<!CDATA[[" and "]]>" on each side of the description string.

    This does not work!!!
    XmlElement Descrip = XMLDoc.CreateElement("Description");
    XmlText DescripText = XMLDoc.CreateTextElement("<!CDATA[[" + Description + "]]>");
    Descrip.AppendChild(DescripText );
    Product.AppendChild(Descrip);
    To make this work, do not output the string to an XMLText instead, output it to a XMLCDataSection. And then appendchild that to an XMLElement like below.

    This works... Yeah.
    XmlElement Descrip = XMLDoc.CreateElement("Description");
    XmlCDataSection DescripCData = XMLDoc.CreateCDataSection(Description);
    Descrip.AppendChild(DescripCData);
    Product.AppendChild(Descrip);
    Please let me know if there is anything I can do for you.

    Always here to help,

    Clint.
    NationwideTool.com
    210 651 1551