asp.net - error deleting items from listview -


hi,

i have problem here. got datatable data display in listview. here behind code function.

protected sub listview1_itemcommand(byval sender object, byval e listviewcommandeventargs)         if (e.commandname) = "sort"             dim txteno label = directcast(e.item.findcontrol("lblid"), label)             /* error here dim deletecommand string = "delete dt id=" & convert.toint32(txteno.text)             session("dt").deletecommand = deletecommand         end if     end sub 

the things when press delete button error occur saying "input string not in correct format." knows problem here?

the problem caused by

convert.toint32(txteno.text)

and value of txteno.text not valid integer.

what value of txteno.text when attempt run code?

as workaround, use integer.tryparse instead.

dim number integer  if integer.tryparse(txteno.text, number)   ' delete.... end if 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -