asp.net - find dynamic added panel -


i'm adding panel web application:

for = 1 amountofrechnungspositionen + 1    dim pnlpositon panel = new panel   pnlpositon.id = "pnlpositon" &   pnlrechungsposition.controls.add(pnlpositon)    ...  next 

now if onclick button, want delete panel. code.

private sub imgdelrechnungsposition_click(sender object, e imageclickeventargs) handles imgdelrechnungsposition.click      amountofrechnungspositionen = convert.toint32(hfamountofrechnungspositionen.value)      dim fcpnlpositon panel = directcast(pnlrechungsposition.findcontrol("placeholderid$pnlpositon" + amountofrechnungspositionen.tostring()), panel)     fcpnlpositon.dispose()      hfamountofrechnungspositionen.value = convert.tostring(amountofrechnungspositionen - 1)  end sub 

but fcpnlpositon nothing. waht i'm doing wrong?

thank u, reading.

try using:

ctype(pnlrechungsposition.findcontrol("pnlpositon" +             amountofrechnungspositionen.tostring()), panel) 

the placeholder text client-side markup , want use direct id property.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -