If file exists check

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • soulfly73
    New Member
    • Sep 2007
    • 7

    If file exists check

    hello All,

    I have an question, I'm very newwhen it comes to ASP.net.
    I am building an site where I want to check on the existince of an image in an certain directory.

    No I have some questions regarding that,
    I have an function
    Code:
    Public Function FileExists(ByVal FileFullPath As String) _
              As Boolean
            
            Dim f As New IO.FileInfo(FileFullPath)
            Return f.Exists
    
        End Function
    How is it possible to call thefunction in an If then statement ?

    I have an line between my code saying:

    Code:
     <% If FileExists(server.MapPath("articlesimages/Thumbs/" & #Eval("PartNumber")  ".jpg") Then%>
    But now I got an error saying "Expression expected" under the # from the Eval. Can anyone tell me how I can achieve the whish to check on the file existance using the function en gettin the variable of #Eval("PartNumb er") ?

    Thank you in advance!!

    Peter
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Hmmm, that seems like it should have worked.
    I do all my coding in the code page and not the design page though, so I'm not positive how it works when you try to put code in the design page.

    Comment

    Working...