asp.net - Adding additional attributes to CheckBoxList on DataBind -


i have checkbox list bound values database, follows

chktoplanguages.datasource = dssitelanguages; chktoplanguages.datatextfield = "language"; chktoplanguages.datavaluefield = "languageid"; chktoplanguages.databind(); 

however, need add value (altlanguage) custom attribute can access value in instances. how can add additional value attribute checkbox items on databind?

you're not going this, when faced issue before way see doing in pure .net following:

// create field on data source objects public languagefield {    {        return languageid + "_" + altlanguage;    } }  chktoplanguages.datasource = dssitelanguages; chktoplanguages.datatextfield = "language"; chktoplanguages.datavaluefield = "languagefield"; chktoplanguages.databind(); 

then, when values, split value "_" , can grab both values.


Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -