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

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -