asp.net - Getting checkboxList values as per selected category from parent checkboxList -


i trying fetch checkboxlist database (working). there 2 checkboxlist on page: first gets fetch when page loads, second gets fetched selected values first checkboxlist. working when select first time first checkboxlist. when select second value first checkboxlist string gets structured

('value1','value2 " & vblf & "')

it should make string this

('value1','value2')

now don't understand & vblf &.

dim joiner string = "" dim whereclause string = string.empty dim categorycondition string = string.empty  = 0 categoryfilter.items.count - 1     if categoryfilter.items(i).selected         dim category string = categoryfilter.items(i).tostring         categorycondition = string.concat(categorycondition, joiner, string.format("'{0}'", category))         if joiner = "" joiner = ","     end if next 

use built-in functionality checked items , concatenate string linq

  1. get checked items control (categoryfilter.checkeditems)
  2. convert them string (cast(of string)())
  3. put ' around them individually (select())
  4. join them , (aggregate())

code:

dim categorycondition string = me.categoryfilter.checkeditems.     cast(of string)().     select(function(i1) string.format("'{0}'", i1)).     aggregate(function(i1, i2) string.format("{0}, {1}", i1, i2)) 

if line feed still exists, it's probable exists in checkedlistbox items itself. said that's coming database, maybe that's (not working).


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -