Subtotal: $118,265.00
I have a visualizer with a structure that has a file upload field. When the visualizer auto generates a table view the file upload field is presented as @Html.Raw(row["Structure_FileUploadFieldName"]) and when it renders there is a link to the file using the filename. What I want is to not have the filename, but a field value from another field in the structure. In the database I noticed that the File Upload data is stored as a path with some square brackets surrounding it, but when it renders using HTML.Raw() I get the following:
<a href="<FilePath>" target="_blank" style="color:Blue;"><FileName></a><br>
Is there a way to get just the filepath so I can create my own <a href> tag?
Hi
You can use following Regex to get URL from link:
@System.Text.RegularExpressions.Regex.Match(row["Structure_FileUploadFieldName"].Replace("\"","'"), "<a\\s+(?:[^>]*?\\s+)?href=([''])(.*?)\\1" ).Groups[2].Value
Thanks