x First time here? Check out the FAQ
Join us a the Umbraco event of the year - get your Codegarden 14 early bird ticket today
  • Avatar1942posts3597karma

    Checked an upload file with razor

    Fuji Kusaka started this topic March 2, 2012 @ 11:52

    Hi Guys,

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

    XSLT

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

      
    And Razor is it something like

    @if(String.isNullOrEmpty.newsFile != null

  • Dennis Pedersen posted this reply March 2, 2012 @ 02:48
    @if(!String.IsNullOrEmpty(Model.newsFile))

Please login or Sign up To post replies