Webcontrol containing other controls issue (please, IMPORTANT!)

  • Thread starter Ivan Demkovitch
  • Start date
I

Ivan Demkovitch

Hi!

I posted question while ago with no reply..

Here is wat I do:

I have website with 1 page (pgracing.com)
Each block/module is a control - .ascx.

In one of them I dynamically create comboboxes, textboxes, etc. Then I add
submit button and hook it up to event handler.

When button pressed I need to read values from this dynamically added
controls.

Page.Find control does not work because ID is not ID I assigned. It gets
prepended with somethig like "Ctl0_"

I understand that ASP.NET does this so I can distinguish between
usercontrols on a page, however it doesn't help me.

I can probably loop thru all controls and compare ID endings, but this
doesn't look correct to me.

How would I get a value? Please ask any questions if I'm not clear.


Thanks!
 
I

Ivan Demkovitch

SOLVED

Since I had code in ASCX ID was prepended with additional ID for ASCX
itself.

Changing Page.FindControl to this.FindControl cured problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top