I am not sure how difficult this is but I have checkboxList with value that is being populated from the database.
This is the markup:
<asp:CheckBoxList runat="server" ID="sects">
The fieldname is doclist and I read the values into this:
While objReader.Read()
With objReader
Dim li As New ListItem(objReader(0).ToString())
sects.Items.Add(li)
End With
End While
It works great so far. Thanks in large part to the great help I get here.
However, we would like to have values associated with the sects.Items.Add(li) concatenated into a url.
The following is the url:
http://default.html and we would like to concatenate it so it looks something like this:
http://default.html?parts="+sects.Items.Add(li)+"&docs=answers&name=meter.zip"
This doesn’t work. I get an error, “this does not produce a value
What we are trying to accomplish is to populate the checkboxList with url string containing the sects values within that url.
Any ideas how to get this to work?
Sorry guys I just keep coming back for more. I do try to fix first though before coming here.
Ok, I think I understand better. I have removed the link button and I have altered the list items so the the text shown is a URL that contains the database field in it, as a URL parameter. The value remains the database field by itself. But if I may ask, what kind of design is this? It looks very shaky. Can you navigate to these pages with distinct data rendered? You want to allow multiple selections, but how can you take that into account by going this route. And if you don’t want the user to be able to have multiple selections, you should use a drop drown list instead. I hope this works for you, but I am looking skeptically at the logic behind this requirement and its implementation.
Markup:
Code Behind: