Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Webcontrol containing other controls issue (please, IMPORTANT!)

Reply
Thread Tools

Webcontrol containing other controls issue (please, IMPORTANT!)

 
 
Ivan Demkovitch
Guest
Posts: n/a
 
      10-07-2003
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!




 
Reply With Quote
 
 
 
 
Ivan Demkovitch
Guest
Posts: n/a
 
      10-07-2003
SOLVED

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

Changing Page.FindControl to this.FindControl cured problem.


"Ivan Demkovitch" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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!
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trapping an Exception ocurring in a Webcontrol at the Page or parent WebControl level. ASP .Net 2 01-31-2005 06:34 PM
WebControl inside of WebControl and attaching events Kasabaarde Sumta ASP .Net Building Controls 0 12-13-2004 09:51 PM
Can a webcontrol (webcontrol.dll) have a configuration file? Luis Ramírez. ASP .Net Building Controls 2 07-06-2004 04:35 PM
Webcontrol containing a UserControl?? Problem ... CubeFish ASP .Net Web Controls 0 02-21-2004 10:32 PM
Webcontrol containing other controls issue (please, IMPORTANT!) Ivan Demkovitch ASP .Net 1 10-07-2003 08:16 PM



Advertisments