473,487 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

PlaceHolders

Hi,

I have some placeholders in my .aspx file, and when I add my controls to
them at runtime I want them to appear in specific positions on the web form,
however there are already some controls that appear statically, but the run
time created controls overwrite them, so is there a way to force the dynamic
controls to appear below them, or anywhere I choose really?

Also my PlaceHolders have ids of "actname1", "actname2", "actname3" etc, so
is there a way that in my code I can use the same code to effectively do
this for each

Label aLabel = new Label();
aLabel.Text = dataRow["activity_name"].ToString()
actname1.Controls.Add(aLabel)

All I want to do is add the appropriate number to the tail end of the
placeholder id, so something like

actname + <rownumber>.Controls.Add(aLabel)

I guess I could iterate thro the Page controls find all the placeholders and
store their references in a list using the row number as an index to the
appropriate placeholder reference???

Any thoughts out there on Xmas Eve, well it is here in NZ! :-)

TIA
Colin B
Nov 18 '05 #1
5 1272
Hello again,

As I wanted my controls to appear in specific positions on the web form, I
wrapped each one with a <div></div> pair, I set the style on each <div> to
position the contents specifically which on viewing the design page it has
placed the placeholders underneath each other, as I want, but when I run it,
and add my new label+text to each one's Controls array the controls are
simply next to each other in a line, not underneath each other as at design
time... :-(

Any thoughts?
TIA
Colin

"Colin Basterfield" <co**************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,

I have some placeholders in my .aspx file, and when I add my controls to
them at runtime I want them to appear in specific positions on the web form, however there are already some controls that appear statically, but the run time created controls overwrite them, so is there a way to force the dynamic controls to appear below them, or anywhere I choose really?

Also my PlaceHolders have ids of "actname1", "actname2", "actname3" etc, so is there a way that in my code I can use the same code to effectively do
this for each

Label aLabel = new Label();
aLabel.Text = dataRow["activity_name"].ToString()
actname1.Controls.Add(aLabel)

All I want to do is add the appropriate number to the tail end of the
placeholder id, so something like

actname + <rownumber>.Controls.Add(aLabel)

I guess I could iterate thro the Page controls find all the placeholders and store their references in a list using the row number as an index to the
appropriate placeholder reference???

Any thoughts out there on Xmas Eve, well it is here in NZ! :-)

TIA
Colin B

Nov 18 '05 #2
Maybe you need to add one more control... a literal containing "<br>" ?

"Colin Basterfield" <co**************@hotmail.com> wrote in message
news:e0**************@TK2MSFTNGP11.phx.gbl...
Hello again,

As I wanted my controls to appear in specific positions on the web form, I
wrapped each one with a <div></div> pair, I set the style on each <div> to
position the contents specifically which on viewing the design page it has
placed the placeholders underneath each other, as I want, but when I run
it,
and add my new label+text to each one's Controls array the controls are
simply next to each other in a line, not underneath each other as at
design
time... :-(

Any thoughts?
TIA
Colin

"Colin Basterfield" <co**************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,

I have some placeholders in my .aspx file, and when I add my controls to
them at runtime I want them to appear in specific positions on the web

form,
however there are already some controls that appear statically, but the

run
time created controls overwrite them, so is there a way to force the

dynamic
controls to appear below them, or anywhere I choose really?

Also my PlaceHolders have ids of "actname1", "actname2", "actname3" etc,

so
is there a way that in my code I can use the same code to effectively do
this for each

Label aLabel = new Label();
aLabel.Text = dataRow["activity_name"].ToString()
actname1.Controls.Add(aLabel)

All I want to do is add the appropriate number to the tail end of the
placeholder id, so something like

actname + <rownumber>.Controls.Add(aLabel)

I guess I could iterate thro the Page controls find all the placeholders

and
store their references in a list using the row number as an index to the
appropriate placeholder reference???

Any thoughts out there on Xmas Eve, well it is here in NZ! :-)

TIA
Colin B



Nov 18 '05 #3
Ken,

Thanks for that but it doesn't make any difference, they still appear one
after the other in a line, so not sure how to proceed now.

I am having a real baptism by fire with HTML, and to a lesser extent
ASP.NET, which keeps me amused... :-)

Any more thoughts?
Thanks again
Colin

"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Maybe you need to add one more control... a literal containing "<br>" ?

"Colin Basterfield" <co**************@hotmail.com> wrote in message
news:e0**************@TK2MSFTNGP11.phx.gbl...
Hello again,

As I wanted my controls to appear in specific positions on the web form, I wrapped each one with a <div></div> pair, I set the style on each <div> to position the contents specifically which on viewing the design page it has placed the placeholders underneath each other, as I want, but when I run
it,
and add my new label+text to each one's Controls array the controls are
simply next to each other in a line, not underneath each other as at
design
time... :-(

Any thoughts?
TIA
Colin

"Colin Basterfield" <co**************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,

I have some placeholders in my .aspx file, and when I add my controls to them at runtime I want them to appear in specific positions on the web

form,
however there are already some controls that appear statically, but the

run
time created controls overwrite them, so is there a way to force the

dynamic
controls to appear below them, or anywhere I choose really?

Also my PlaceHolders have ids of "actname1", "actname2", "actname3" etc,
so
is there a way that in my code I can use the same code to effectively
do this for each

Label aLabel = new Label();
aLabel.Text = dataRow["activity_name"].ToString()
actname1.Controls.Add(aLabel)

All I want to do is add the appropriate number to the tail end of the
placeholder id, so something like

actname + <rownumber>.Controls.Add(aLabel)

I guess I could iterate thro the Page controls find all the placeholders and
store their references in a list using the row number as an index to

the appropriate placeholder reference???

Any thoughts out there on Xmas Eve, well it is here in NZ! :-)

TIA
Colin B


Nov 18 '05 #4
Hi Colin,

Perhaps you could show us the HTML code output that you are getting? That
way we could work on getting the result right.

Hmmmm... are you using absolute positioning? That might be defeating other
code that attempts to use layout mode.

"Colin Basterfield" <co**************@hotmail.com> wrote in message
news:e7*************@TK2MSFTNGP12.phx.gbl...
Ken,

Thanks for that but it doesn't make any difference, they still appear one
after the other in a line, so not sure how to proceed now.

I am having a real baptism by fire with HTML, and to a lesser extent
ASP.NET, which keeps me amused... :-)

Any more thoughts?
Thanks again
Colin

"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Maybe you need to add one more control... a literal containing "<br>" ?

"Colin Basterfield" <co**************@hotmail.com> wrote in message
news:e0**************@TK2MSFTNGP11.phx.gbl...
> Hello again,
>
> As I wanted my controls to appear in specific positions on the web
> form, I > wrapped each one with a <div></div> pair, I set the style on each <div> to > position the contents specifically which on viewing the design page it has > placed the placeholders underneath each other, as I want, but when I
> run
> it,
> and add my new label+text to each one's Controls array the controls are
> simply next to each other in a line, not underneath each other as at
> design
> time... :-(
>
> Any thoughts?
> TIA
> Colin
>
> "Colin Basterfield" <co**************@hotmail.com> wrote in message
> news:%2****************@TK2MSFTNGP11.phx.gbl...
>> Hi,
>>
>> I have some placeholders in my .aspx file, and when I add my controls to >> them at runtime I want them to appear in specific positions on the web
> form,
>> however there are already some controls that appear statically, but
>> the
> run
>> time created controls overwrite them, so is there a way to force the
> dynamic
>> controls to appear below them, or anywhere I choose really?
>>
>> Also my PlaceHolders have ids of "actname1", "actname2", "actname3" etc, > so
>> is there a way that in my code I can use the same code to effectively do >> this for each
>>
>> Label aLabel = new Label();
>> aLabel.Text = dataRow["activity_name"].ToString()
>> actname1.Controls.Add(aLabel)
>>
>> All I want to do is add the appropriate number to the tail end of the
>> placeholder id, so something like
>>
>> actname + <rownumber>.Controls.Add(aLabel)
>>
>> I guess I could iterate thro the Page controls find all the placeholders > and
>> store their references in a list using the row number as an index to the >> appropriate placeholder reference???
>>
>> Any thoughts out there on Xmas Eve, well it is here in NZ! :-)
>>
>> TIA
>> Colin B
>>
>>
>
>



Nov 18 '05 #5
Not sure if a dim view is taken of attaching a file, but given that you
asked for HTML, then unles I attach it you won't see it in the message.

If the moderator is reading, please accept my apologies, and perhaps suggest
a way of achieving the requirement

I am using absolute positioning, so I will play around with that whilst I
wait for a reply :-)

Cheers Ken
Colin

"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:eI**************@TK2MSFTNGP12.phx.gbl...
Hi Colin,

Perhaps you could show us the HTML code output that you are getting? That
way we could work on getting the result right.

Hmmmm... are you using absolute positioning? That might be defeating other
code that attempts to use layout mode.

"Colin Basterfield" <co**************@hotmail.com> wrote in message
news:e7*************@TK2MSFTNGP12.phx.gbl...
Ken,

Thanks for that but it doesn't make any difference, they still appear one after the other in a line, so not sure how to proceed now.

I am having a real baptism by fire with HTML, and to a lesser extent
ASP.NET, which keeps me amused... :-)

Any more thoughts?
Thanks again
Colin

"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Maybe you need to add one more control... a literal containing "<br>" ?

"Colin Basterfield" <co**************@hotmail.com> wrote in message
news:e0**************@TK2MSFTNGP11.phx.gbl...
> Hello again,
>
> As I wanted my controls to appear in specific positions on the web
> form,

I
> wrapped each one with a <div></div> pair, I set the style on each <div>
to
> position the contents specifically which on viewing the design page
it has
> placed the placeholders underneath each other, as I want, but when I
> run
> it,
> and add my new label+text to each one's Controls array the controls
are > simply next to each other in a line, not underneath each other as at
> design
> time... :-(
>
> Any thoughts?
> TIA
> Colin
>
> "Colin Basterfield" <co**************@hotmail.com> wrote in message
> news:%2****************@TK2MSFTNGP11.phx.gbl...
>> Hi,
>>
>> I have some placeholders in my .aspx file, and when I add my controls to
>> them at runtime I want them to appear in specific positions on the
web > form,
>> however there are already some controls that appear statically, but
>> the
> run
>> time created controls overwrite them, so is there a way to force the
> dynamic
>> controls to appear below them, or anywhere I choose really?
>>
>> Also my PlaceHolders have ids of "actname1", "actname2", "actname3"

etc,
> so
>> is there a way that in my code I can use the same code to effectively do
>> this for each
>>
>> Label aLabel = new Label();
>> aLabel.Text = dataRow["activity_name"].ToString()
>> actname1.Controls.Add(aLabel)
>>
>> All I want to do is add the appropriate number to the tail end of

the >> placeholder id, so something like
>>
>> actname + <rownumber>.Controls.Add(aLabel)
>>
>> I guess I could iterate thro the Page controls find all the

placeholders
> and
>> store their references in a list using the row number as an index to

the
>> appropriate placeholder reference???
>>
>> Any thoughts out there on Xmas Eve, well it is here in NZ! :-)
>>
>> TIA
>> Colin B
>>
>>
>
>




Nov 18 '05 #6

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

Similar topics

3
4843
by: DotNetGruven | last post by:
Hi, Is there a trick to using nested PlaceHolders? I have a WebForm that has 3 PlaceHolders on it: headerPlaceHolder contentPlaceHolder footerPlaceHolder
1
307
by: buran | last post by:
Dear ASP.NET Programmers, Please consider the following code. How can I reach the textbox with the ID txtBurak in the "pe.ascx"? Private Sub cblMRParts_SelectedIndexChanged(ByVal sender As...
1
13623
by: Josh | last post by:
Hi Guys, I have been having a big problem with trying to pass parameters into a user control when the user control is dynamically loaded into a placholder. I am developing in c#. I have get...
0
1707
by: Sinisa Ruzin | last post by:
Hi all, I had problem with dynamically adding/removing controls;ascx, Controls.Add(Page.LoadControl... in the same page of the IBuySpy portal. ASP.NET, C#. I added buttons to the main ASCX loaded...
4
1369
by: Alan Silver | last post by:
Hello, I am displaying product details on a page and am allowing the site owner to specify the style in which the product details are displayed. I am debating which of two approaches to use here...
2
1888
by: Dan Sugalski | last post by:
Is there any way to convince explain to go do its thing when given a query with placeholders in it? I'm trying to do some performance checking of some of the queries built into a system I'm...
11
2408
by: Dan Sugalski | last post by:
Is there any good way to speed up SQL that uses like and has placeholders? Here's the scoop. I've got a system that uses a lot of pre-generated SQL with placeholders in it. At runtime these SQL...
0
938
by: nemesis.saurabh | last post by:
hi, i am using VS 2005. i have created a master.master. i have added 2 content placeholders, i am able to edit them in the corresponding content page but if i am adding anymore placeholders in...
1
1532
by: pankajit09 | last post by:
Hello, Is it possible to put two placeholders in Ajax Updater ? or Can I use the same placeholder(div ID ) at two places in HTML? var myAjax =...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7132
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7180
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7341
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5439
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4870
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
266
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.