Imagine being paid to improve your favorite CMS!

It could be you! Umbraco HQ are hiring and are looking for both talents and senior developers. Wonderful workplace, friendly colleagues and competitive salary.

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 2193 posts 4165 karma points
    Mar 02, 2012 @ 11:52
    Fuji Kusaka
    0

    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?

    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 8 posts 28 karma points
    Mar 02, 2012 @ 14:48
    Dennis Pedersen
    0
    @if(!String.IsNullOrEmpty(Model.newsFile))
Please Sign in or register to post replies

Write your reply to:

Draft