Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Jill Graham #1
control ID's
Hi,
My web page loads the controls dynamically using
Page.LoadControl("~/myControls/myControl.ascx")
The control myControl.ascx contains several controls with following ID's :
"_content1", "_content2", "_content3", ...
Once the control myControl.ascx has been loaded into the web page, the ID's
have been changed : "_ctl0:_content1", "_ctl1:_content2", ...
and the method Page.FindControl("_control1") returns nothing !
Does anybody know how I can continu to use the Page.FindControl method ?
Jill
Jill Graham Guest
-
Loop and ID's
Hi, I'm trying to reference the row ID using a loop and query. I was thinking some thing like this would work (although it doesn't) <cfquery... -
Getting a list of ID's from Selected Rows
What I am trying to do is gets a list of the attribute ID's for each selected row. What I was wondering was if there was a way to loop through the... -
Is there any value in ID's Wildcard S&R ?
I can think of no scenerio in which a wildcard search should not return the initial value of the searched character. As it works now, a wildcard S&R... -
Windows Event ID's
Wondering if anyone has a list of all the event ID's for the Security and System Logs. Chris -
display COM+ process id's in an asp page
Making a good old fashioned asp page and need to be able to display the IIS COM+ process id's (i.e. those that show up when attaching to a process... -
ccallen #2
Re: control ID's
Try setting the parent control's (myControl) id in the containing page.
Example:
mc = Page.LoadControl("~/myControls/myControl.ascx")
mc.ID = "MyControl1"
If you place the mc into a someother control (ie. PlaceHolder), then you
will need to take that into account when building a path to it and its
children.
ccallen
"Jill Graham" <jills_graham@yahoo.com.au> wrote in message
news:emLuDXfLEHA.2456@TK2MSFTNGP12.phx.gbl...ID's> Hi,
>
> My web page loads the controls dynamically using
> Page.LoadControl("~/myControls/myControl.ascx")
>
> The control myControl.ascx contains several controls with following ID's :
> "_content1", "_content2", "_content3", ...
>
> Once the control myControl.ascx has been loaded into the web page, the> have been changed : "_ctl0:_content1", "_ctl1:_content2", ...
> and the method Page.FindControl("_control1") returns nothing !
>
> Does anybody know how I can continu to use the Page.FindControl method ?
>
> Jill
>
>
>
ccallen Guest
-
Fred Hirschfeld #3
Re: control ID's
You actually need add public properties (or methods) to you control to
access the values in the embedded controls.
Fred
"ccallen" <ccallen@windowpane.com> wrote in message
news:er5VgwfLEHA.2716@tk2msftngp13.phx.gbl...:> Try setting the parent control's (myControl) id in the containing page.
>
> Example:
> mc = Page.LoadControl("~/myControls/myControl.ascx")
> mc.ID = "MyControl1"
>
> If you place the mc into a someother control (ie. PlaceHolder), then you
> will need to take that into account when building a path to it and its
> children.
>
> ccallen
>
> "Jill Graham" <jills_graham@yahoo.com.au> wrote in message
> news:emLuDXfLEHA.2456@TK2MSFTNGP12.phx.gbl...> > Hi,
> >
> > My web page loads the controls dynamically using
> > Page.LoadControl("~/myControls/myControl.ascx")
> >
> > The control myControl.ascx contains several controls with following ID's> ID's> > "_content1", "_content2", "_content3", ...
> >
> > Once the control myControl.ascx has been loaded into the web page, the>> > have been changed : "_ctl0:_content1", "_ctl1:_content2", ...
> > and the method Page.FindControl("_control1") returns nothing !
> >
> > Does anybody know how I can continu to use the Page.FindControl method ?
> >
> > Jill
> >
> >
> >
>
Fred Hirschfeld Guest
-
Victor Garcia Aprea [MVP] #4
Re: control ID's
Hi Jill,
If you're looking for a child control of your usercontrol, and you're
starting the search at the page, you'll need to do:
[C#]
FindControl ("YourUserControlID:YourChildID");
Note the ':' syntax to help the FindControl method in finding your control.
Let me know if this is what you're after or not,
--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
[url]http://obies.com/vga/blog.aspx[/url]
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
"Jill Graham" <jills_graham@yahoo.com.au> wrote in message
news:emLuDXfLEHA.2456@TK2MSFTNGP12.phx.gbl...ID's> Hi,
>
> My web page loads the controls dynamically using
> Page.LoadControl("~/myControls/myControl.ascx")
>
> The control myControl.ascx contains several controls with following ID's :
> "_content1", "_content2", "_content3", ...
>
> Once the control myControl.ascx has been loaded into the web page, the> have been changed : "_ctl0:_content1", "_ctl1:_content2", ...
> and the method Page.FindControl("_control1") returns nothing !
>
> Does anybody know how I can continu to use the Page.FindControl method ?
>
> Jill
>
>
>
Victor Garcia Aprea [MVP] Guest



Reply With Quote

