Copied to clipboard

Flag this post as spam?

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

  • Fuji Kusaka 2105 posts 3972 karma points
    Mar 02, 2012 @ 11:52
    Fuji Kusaka

    Checked an upload file with razor

    Hi Guys,

    Is there any example of how to check a empty upload field in razor like you would do in XSLT?


     <xsl:variable name="pdfFile" select="newsFile" />   
              <xsl:if test="$pdfFile != ''">
                  <a target="_blank">
                    <xsl:attribute name="href">                    
                       <xsl:value-of select="newsFile"/>                                  

    And Razor is it something like

    @if(String.isNullOrEmpty.newsFile != null
  • Dennis Pedersen28 karma points
    Mar 02, 2012 @ 14:48
    Dennis Pedersen
Please Sign in or register to post replies

Write your reply to:

Draft is the community mothership for Umbraco, the open source cms. With a friendly forum for all your questions, a comprehensive documentation and a ton of packages from the community. This site is running Umbraco version 7.3.0