473,378 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

adding child controls problem

I'm iterating through all controls in ControlPlaceholder to locate specific
HyperLink controls. When found I want to add an Image control right after -
I'm visually placing seperator images between hyperlinks. When I do
_hl.Controls.Add(_img) the hyperlinks dissapear, although the image is
there?!

foreach(...)
{
if (_ctrl3 is HyperLink)
{
HyperLink _hl = (HyperLink) _ctrl3;
Image _img = new Image();
_ img.ImageUrl = "~/img/seperator.gif";
_hl.Controls.Add(_img);
}
}
Sep 8 '06 #1
2 1280
Daves,

If what you're looking for as an end result is:
<asp:hyprlink ..></asp:hyperlink><asp:img ..></asp:img>

The you need the AddAt method of the container.

From what you've said I think you're ending up with:
<asp:hyprlink ..><asp:img ..></asp:img></asp:hyperlink>

Does that help?

Rob MacFadyen

"Daves" <db****@simnet.iswrote in message
news:O7**************@TK2MSFTNGP04.phx.gbl...
I'm iterating through all controls in ControlPlaceholder to locate
specific HyperLink controls. When found I want to add an Image control
right after - I'm visually placing seperator images between hyperlinks.
When I do _hl.Controls.Add(_img) the hyperlinks dissapear, although the
image is there?!

foreach(...)
{
if (_ctrl3 is HyperLink)
{
HyperLink _hl = (HyperLink) _ctrl3;
Image _img = new Image();
_ img.ImageUrl = "~/img/seperator.gif";
_hl.Controls.Add(_img);
}
}

Sep 8 '06 #2
yep it did. Thanks.
"Rob MacFadyen" <rmacfadyen_at_gmail.comwrote in message
news:OA*************@TK2MSFTNGP06.phx.gbl...
Daves,

If what you're looking for as an end result is:
<asp:hyprlink ..></asp:hyperlink><asp:img ..></asp:img>

The you need the AddAt method of the container.

From what you've said I think you're ending up with:
<asp:hyprlink ..><asp:img ..></asp:img></asp:hyperlink>

Does that help?

Rob MacFadyen

"Daves" <db****@simnet.iswrote in message
news:O7**************@TK2MSFTNGP04.phx.gbl...
>I'm iterating through all controls in ControlPlaceholder to locate
specific HyperLink controls. When found I want to add an Image control
right after - I'm visually placing seperator images between hyperlinks.
When I do _hl.Controls.Add(_img) the hyperlinks dissapear, although the
image is there?!

foreach(...)
{
if (_ctrl3 is HyperLink)
{
HyperLink _hl = (HyperLink) _ctrl3;
Image _img = new Image();
_ img.ImageUrl = "~/img/seperator.gif";
_hl.Controls.Add(_img);
}
}


Sep 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Juan Romero | last post by:
Hey guys, I am working on a web custom control that basically draws a table (ASP Table) with a few child controls in the cells. I have a command button inside one of these cells. The problem I...
2
by: Brian Henry | last post by:
I want to create a web custom control (not a user web control) that I can add a XML translation control into, how would I do this? I am using the web custom control as a template that I can add to...
3
by: Lance | last post by:
I've noticed that controls that are contained in MDI child forms fail to raise MouseLeave events if the MDI child form's MdiParent property is set to Nothing (after it was set to an existing MDI...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
2
by: JohnR | last post by:
Let's say I have an MDI parent form with a textbox. If I create an MDI child form and, at runtime, move the MDI child window over the textbox on the MDI parent, the textbox appears in front of the...
9
by: Neo Geshel | last post by:
I have strip-mined, strip-searched, and completely exhausted the Internet (up to the 30th page on Google, with 100 results per page!!), all without finding an answer to my question AS TO WHY IT...
4
by: Richard Lewis Haggard | last post by:
What is the mechanism by which a child window can notify its parent that it has been clicked on? -- Richard Lewis Haggard www.Haggard-And-Associates.com
4
by: Duncan Dimech | last post by:
Dear All I am writing a tool which requires to have controls added to it dynamically. To make the task more complex, the addition of the control cannot happen anywhere but it has to be instead of...
12
by: Bob Jones | last post by:
I have an odd business requirement and I think that the implementation is not correct in the terms of OOP development. Any help on the concepts would be very appreciated! We currently have a...
3
by: Adam Right | last post by:
Hi, I am developing an application which has established on MDI Form and there are many MDI Child forms. My problem is starting when i close the mdi child forms. They are not disposed from the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.