Set CheckBox “Checked” propery in ASP repeater

前端 未结 4 1541
孤独总比滥情好
孤独总比滥情好 2021-01-14 08:16

I was wondering if it\'s possible to set the checked propery of a checkbox, using a bool variable form the repeater\'s datasource?

I\'ve tried several ways but witho

4条回答
  •  一整个雨季
    2021-01-14 09:02

    I'm fairly sure that it should work this way:

    Checked='<%# Bind("IsDefault") %>'
    

    By the way, there's a missing < in your first approach:

    Checked="%#Eval...
    

    Edit: (since you've also edited your question and corrected it)

    Now there's something else wrong, you've two consecutive quotes here:

    Checked="<%#Eval("
    

提交回复
热议问题