Changing output format of checkBoxList control

A

Andy B

I have the following checkBoxList in a web page. I set the DataSource in the
code behind (shown below the control) to a Dictionary<string, string>
collection. When I run the page, I get some formatting in the control that I
want to change. For this example, I get the key/value pair of the dictionary
inside of [] ([key, value]). For example:

Page output:

[Words, Just testing this thing...]



I need to make custom formatting with html and stuff. How would I do that?

Control:

<asp:CheckBoxList ID="WordList" runat="server">

</asp:CheckBoxList>

CodeBehind:

public partial class _default : System.Web.UI.Page {

Contract StockContract = new Contract();

protected void Page_Load(object sender, EventArgs e) {

StockContract.Dictionary = new ContractDictionary<string, string>();

StockContract.Dictionary.Add("Words", "Just testing this thing...");

WordList.DataSource = StockContract.Dictionary;

WordList.DataBind();

}

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top