Copied to clipboard

Flag this post as spam?

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


  • Johan 95 posts 264 karma points
    Dec 07, 2015 @ 08:12
    Johan
    0

    What datatype is RTE?

    I want to validate an RTE but I'm not quite sure what datatype it is.

    For example, if I want to validate a textstring I do it like this:

     <td data-title="Adress">
                                    @if (!string.IsNullOrEmpty(school.adress))
                                            {
                                            @school.adress
                                            }
                                            else
                                            {
                                            <text>&nbsp;</text>
                                            }
                                </td>
    

    But for an RTE, I can't use !string because it's not a string.

    How would the validation look like for RTE?

  • Dave Woestenborghs 3325 posts 11170 karma points MVP 5x admin c-trib
    Dec 07, 2015 @ 08:30
    Dave Woestenborghs
    100

    The RTE returns a IHtmlstring object.

    So you need to do this :

    <td data-title="Adress">
                                    @if (!string.IsNullOrEmpty(school.adress.ToString()))
                                            {
                                            @school.adress
                                            }
                                            else
                                            {
                                            <text>&nbsp;</text>
                                            }
                                </td>
    

    Dave

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies