Changing output format of checkBoxList control

Discussion in 'ASP .Net' started by Andy B, Apr 24, 2008.

  1. Andy B

    Andy B Guest

    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();

    }

    }
     
    Andy B, Apr 24, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dennis Johansson
    Replies:
    1
    Views:
    499
    Dennis Johansson
    Aug 21, 2003
  2. Samridhi Kumar Shukla
    Replies:
    1
    Views:
    527
    Alvin Bruney
    Nov 30, 2003
  3. JD
    Replies:
    5
    Views:
    11,674
    NetArchitect
    Aug 8, 2007
  4. Patrick.O.Ige
    Replies:
    5
    Views:
    19,122
    Patrick.O.Ige
    Jun 19, 2005
  5. Replies:
    1
    Views:
    269
    Raymond Hettinger
    Jan 11, 2007
Loading...

Share This Page