Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kevon K. Hayes 255 posts 281 karma points
    Oct 18, 2010 @ 23:08
    Kevon K. Hayes
    0

    How do you obtain the value of the RTE using .NET C#

    I want to inject the html of from the RTE into a usercontrol.  This didn't work:

    private readonly Node _currentNode = Node.GetCurrent();
    public string _articleBody1 = "";
    _articleBody1 = _currentNode.GetProperty("corArticle1").Value;
    public string ArticleBody1 
    {
      get { return _articleBody1; }
    }
    .ascx
    <telerik:control>
    <%= _articleBody1%>
    </telerik:control>

    Any help would be appreciated...

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Oct 18, 2010 @ 23:57
    Stefan Kip
    0

    What do you mean exactly with 'This didn't work'? What's the output?

    And just one small generic programming question; why are you assigning an empty string to _articleBody1 before assigning the property's value to it?

  • Kevon K. Hayes 255 posts 281 karma points
    Oct 19, 2010 @ 00:21
    Kevon K. Hayes
    0

    >>>What's the output?

    Apologies for the vagueness. I do not believe this is Umbraco related now...as I see the output in Firebug and Page source but the HTML isn't visible. 

    >>>And just one small generic programming question; why are you assigning an empty string to _articleBody1 before assigning the property's value to it? 

    Habit I suppose... advise if I should do different.

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Oct 19, 2010 @ 09:39
    Stefan Kip
    0

    Well, there are two 'negative things':
    - Assigning an empty string for nothing is just unneccasary ;-)
    - If you do have to assign an empty string, use 'string someString = string.Empty', this won't allocate new memory unlike 'string someString = ""'

Please Sign in or register to post replies

Write your reply to:

Draft