I have a requirement that I need to display checkbox on pdf document generated using itextsharp. However, as itextsharp doesn't support html input tag, the checkboxes did not appear on my page. I use asp.net checkboxlist control and I am thinking about adding background image to display the checkbox as checked or not checked, but for some reason, I could not get it to display still. Here is my code:
Protected Sub Checkboxlist1_DataBound(sender As Object, e As EventArgs) Handles Checkboxlist1.DataBound
If test <> "" Then
Dim checklist As List(Of String) = ReturnListofStringClass.ReturnChecklistListOfString(test)
For i = 0 To Checkboxlist1.Items.Count - 1
For Each id As String In checklist
If Checkboxlist1.Items(i).Value = id Then
Checkboxlist1.Items(i).Selected = True
Checkboxlist1.Items(i).Attributes("style") = "background: url(http://renegadeox.com/img/on.png) no-repeat red; height:300px; color: blue; font-size:20px;"
End If
Next
Next
End If
End Sub
The background color applied but not the image. Thanks for your help.