I’m trying to get the student photo to display in Page_DataRendering section by extending the $header variable, and this is the code I used, and I didn’t have the Href field set, it worked, and the photo displayed$header .= “”;The C_StudentPhoto field uses file path encryption, with upload path located above the root directory folder, so I can’t directly link to the image.How can I get the image to display? Whether the image contains a link or not is unimportant to me.Right now I have HREF field set to C_StudentPhoto and Original field value is checked.Ideally i don’t want this field to be a HREF at all.I only want to get the image to display in Page_DataRendering of the View page.C_StudentPhoto is a custom field which selects photo from another table.
- Custom Field or not is not important, you get the file name from other table and it is handled as a normal field.
- You do need to set the HREF field unless the field’s View Tag is set as IMAGE.
- There is no need to set Original field value because the field is a not a lookup field (right?).
- If the field can be displayed in the View page as image, then it should also work in Page_DataRendering because they both use the same HrefValue.
You should inspect HTML element in the page, compare the HTML of the two images (one from your server event and the other from the field) and find out why the image at the top is not displayed.
The clue was in point 4 - Thank-you!I had accidentally turned off that field in the view so as not to display it in the record. When in fact it was already turned off in the record by using $this->C_StudentPhoto->Visible = false; in Page_DataRendering.
Now it’s working fine. Often its something so simple that gets overlooked.