Greetings experts,
The code below checks to see if the filename on the server matches the filename from the database.
If yes, the Listen link is activated, allowing the user to play and listen to recording.
If no file on the server matches the file on the DB for a particular record, the Listen link is disabled.
All of this works great.
The only issue I am not able to resolve is how to add a background color of red to the Listen link if it is disabled.
Any ideas if this is possible?
Many thanks in advance
'/Markup
<asp:HyperLink runat="server" id="HyperLink1"
NavigateUrl='<%#String.Format("http://is-server1/Archives/{1}/snoop_{0}.wav", Eval("filename"), Eval("servers")) %>'
Enabled='<%# RecordingExists(Eval("filename", "{0}"), Eval("servers", "{0}")) %>' ToolTip='<%# If(RecordingExists(Eval("filename", "{0}"), Eval("servers", "{0}")), "Play recording", "No audio found") %>' Text="Listen"/>
'/VB
Protected Function RecordingExists(ByVal filename As String, ByVal servername As String) As Boolean
Dim virtualPath As String = String.Format("/Archives/{1}/snoop_{0}.wav", filename, servername)
Dim physicalPath As String = Server.MapPath(virtualPath)
Return System.IO.File.Exists(physicalPath)
End Function