AndyGB4
Posts: 122
|
Posted: 02/09/2016, 8:13 AM |
|
Hi, I have a check box list that's pulled from a database, and I was wondering if it's possible to show a thumbnail (the URL is saved in the same database table) next each individual checkBox, instead of the Text Label that there is now?
For some reason, when you make changes to that Text Label, the changes aren't reflected when you open up the webpage. I even checked the source code of the web page, but there's no trace of any changes made.
Has anyone figured out a way to modify the Label? Or to add an image after the checkbox?
Thanks!
|
|
|
Oper
Posts: 1195
|
Posted: 02/09/2016, 10:18 AM |
|
that's very simple:
FormName.LabelName.Value="MyData <table><tr><td>Data 1</td><td>Data 2</td></tr></table>"
Label Type Property should be HTML
or i'm missing something in your question
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
|
|
eratech
Posts: 513
|
Posted: 02/09/2016, 1:21 PM |
|
If pulling from the DB I tend to create the img or html I need for the label in the query and have the label set as HTML type as oper said.
select id, name, concat(item, '<img src="',imagename,'">') as checklistitem from mytable where status=1
I know it tends to obscure the source of the image but it's quick and powerful.
Also - the checkbox list will be an array so you can loop through and modify that in BeforeShow.
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
AndyGB4
Posts: 122
|
Posted: 02/09/2016, 1:30 PM |
|
What a clever idea, thanks guys, I'll try that out!
|
|
|
Oper
Posts: 1195
|
Posted: 02/09/2016, 2:05 PM |
|
or assign the content of the Image to the Label (off course set as HTML)
and only do this:
Sender.value="<img src=' " & sender.value & " '>"
(Has space between single and doble apostrophe just for easy reading
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
|
|
AndyGB4
Posts: 122
|
Posted: 02/10/2016, 8:50 AM |
|
So I managed to loop through the CheckBoxList in the BeforeShow event.
Thanks for that tip.
I'm going to keep playing around with it and make some modifications to get it exactly how I want it.
For anyone else that might fall upon this forum thread, this is how I did it.
(I was using C# InMotion)
foreach (ListItem checkBoxValue in ((MTCHeckBoxList)sender).Items){
//to access the value of each label, you can just use the variable in the loop (checkBoxValue).
}
Although, if I want to modify that value, I can't because it's a foreach loop, so I guess I'd have to use a regular for loop, and get the Array's length.
|
|
|
|