|
| [WB21] - Display an image |
| Iniciado por guest, 27,jun. 2016 11:23 - 3 respuestas |
| |
| | | |
|
| |
| Publicado el 27,junio 2016 - 11:23 |
Hi All
Classic WebDev 21 site
I am trying to load a dynamic page which contains an image control. I want to programmatically assign an image to the control when the user chooses to load the page (there is a condition which determines the image to display).
I use Image_Control_Name = Full_path_and_name_to_image_file in the server initialization code of the page.
However the image does not display. What settings or options or other things do I need to set to make this work?
Thanks |
| |
| |
| | | |
|
| | |
| |
| Publicado el 27,junio 2016 - 13:27 |
Hi JP
3 very important things for images:
1. in the image description, you need to choose the origin of the image properly (from the DB, from a directory, etc) 2. You also need to make sure that the image itself is in a SUBdirectory of your web site. If you don't, you'll have to modify permissions on your server to make it work when you deploy, thus lessening the security. 3. If you are in server code, you need to use a full path (windows style) to set your field, but if you are in browser code, you need to use a URL instead (as the browser doesn't know or have access to the server)
Best regards |
| |
| |
| | | |
|
| | |
| |
| Publicado el 27,junio 2016 - 13:43 |
Fabrice, thanks for that. Where does one set the origin of the image? I see a drop down called "Type" which offers Static, Dynamic, From Database Path, From Database Memo, and Generated. Is this what you refer to? If so, which option is the one to use in order to load an image file from a disk folder?
Thanks |
| |
| |
| | | |
|
| | |
| |
| Publicado el 27,junio 2016 - 17:40 |
Fabrice
Success - I changed the image type (General tab) to Generated, then in the server initialization code set the path to the image file. Works well.
Thanks |
| |
| |
| | | |
|
| | | | |
| | |
|