Dynamically Adding Controls to an aspx page
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngvb' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Eric Landes (VIP)
Folks,
I currently have a page set up that dynamically adds controls to a web =
page
(textbox, and calendars, also labels). The controls are adding =
correctly. =20

My issue is placement. Basically I place a label, then the textbox, or
calendar control after the label. I want a line break between each of
these, but have not figured out how to do this. Any ideas? I tried
creating a literal with "<br>" as the text, but that doesnt work. Below =
is
the code:

dim oEntry as new textbox()
dim oLiteral as literal()
dim oLabel as new Label()

oliteral.Text =3D "<br>"
Controls.Add(oLabel)
Controls.Add(oLiteral)
Controls.Add(oEntry)
Controls.Add(oLiteral)

The label still displays on the same line as the textbox.
Any ideas? TIA

*************************=20
Eric Landes=20
Senior Programmer/Analyst (Partners Health Plan)=20
For Articles on Crystal.Net, Datagrids and more check out
http://www.aspalliance.com/corporatecoder/
*************************=20
All statements expressed are my own, and do not reflect the opinion of =
my
employer, unless stated otherwise.=20

Confidentiality Notice: This e-mail message, including any
attachments, is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not
the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message.

PARTNERS Health Plan Phone: 574-233-4899
100 E. Wayne St., Suite 502 Fax: 574-234-7484
South Bend, IN 46601 www.partnersindiana.com

Reply to this message...
 
    
Jason Peterson
Is your page's form set to GridLayout? I think you want FlowLayout.
Also, you can try two breaks "<BR><BR>" or a paragraph "<P></P>".

-----Original Message-----
From: Eric Landes [mailto:Click here to reveal e-mail address]=20
Sent: Thursday, 15 August, 2002 7:33 AM
To: aspngvb
Subject: [aspngvb] Dynamically Adding Controls to an aspx page

Folks,
I currently have a page set up that dynamically adds controls to a web
page
(textbox, and calendars, also labels). The controls are adding
correctly. =20

My issue is placement. Basically I place a label, then the textbox, or
calendar control after the label. I want a line break between each of
these, but have not figured out how to do this. Any ideas? I tried
creating a literal with "<br>" as the text, but that doesnt work. Below
is
the code:

dim oEntry as new textbox()
dim oLiteral as literal()
dim oLabel as new Label()

oliteral.Text =3D "<br>"
Controls.Add(oLabel)
Controls.Add(oLiteral)
Controls.Add(oEntry)
Controls.Add(oLiteral)

The label still displays on the same line as the textbox.
Any ideas? TIA

Reply to this message...
 
    
Eric Landes (VIP)
The positioning is set <body MS_POSITIONIONING=3D"GridLayout">. I'm =
going to
try to create a literal array, and see if that's the problem.

Eric

-----Original Message-----
From: Jason Peterson [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 5:16 PM
To: aspngvb
Subject: [aspngvb] RE: Dynamically Adding Controls to an aspx page

Is your page's form set to GridLayout? I think you want FlowLayout.
Also, you can try two breaks "<BR><BR>" or a paragraph "<P></P>".

-----Original Message-----
From: Eric Landes [mailto:Click here to reveal e-mail address]=20
Sent: Thursday, 15 August, 2002 7:33 AM
To: aspngvb
Subject: [aspngvb] Dynamically Adding Controls to an aspx page

Folks,
I currently have a page set up that dynamically adds controls to a web
page
(textbox, and calendars, also labels). The controls are adding
correctly. =20

My issue is placement. Basically I place a label, then the textbox, or
calendar control after the label. I want a line break between each of
these, but have not figured out how to do this. Any ideas? I tried
creating a literal with "<br>" as the text, but that doesnt work. Below
is
the code:

dim oEntry as new textbox()
dim oLiteral as literal()
dim oLabel as new Label()

oliteral.Text =3D "<br>"
Controls.Add(oLabel)
Controls.Add(oLiteral)
Controls.Add(oEntry)
Controls.Add(oLiteral)

The label still displays on the same line as the textbox.
Any ideas? TIA

| [aspngvb] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp =3D JOIN/QUIT

Confidentiality Notice: This e-mail message, including any
attachments, is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not
the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message.

PARTNERS Health Plan Phone: 574-233-4899
100 E. Wayne St., Suite 502 Fax: 574-234-7484
South Bend, IN 46601 www.partnersindiana.com

Reply to this message...
 
    
li
use it,It works for me

Controls.Add(new literalControl("<br>"))

----- Original Message -----
From: "Jason Peterson" <Click here to reveal e-mail address>
To: "aspngvb" <Click here to reveal e-mail address>
Sent: Thursday, August 15, 2002 4:16 PM
Subject: [aspngvb] RE: Dynamically Adding Controls to an aspx page

Is your page's form set to GridLayout? I think you want FlowLayout.
Also, you can try two breaks "<BR><BR>" or a paragraph "<P></P>".

-----Original Message-----
From: Eric Landes [mailto:Click here to reveal e-mail address]
Sent: Thursday, 15 August, 2002 7:33 AM
To: aspngvb
Subject: [aspngvb] Dynamically Adding Controls to an aspx page

Folks,
I currently have a page set up that dynamically adds controls to a web
page
(textbox, and calendars, also labels). The controls are adding
correctly.

My issue is placement. Basically I place a label, then the textbox, or
calendar control after the label. I want a line break between each of
these, but have not figured out how to do this. Any ideas? I tried
creating a literal with "<br>" as the text, but that doesnt work. Below
is
the code:

dim oEntry as new textbox()
dim oLiteral as literal()
dim oLabel as new Label()

oliteral.Text = "<br>"
Controls.Add(oLabel)
Controls.Add(oLiteral)
Controls.Add(oEntry)
Controls.Add(oLiteral)

The label still displays on the same line as the textbox.
Any ideas? TIA

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

-------------------------------------------
Introducing NetZero Long Distance
Unlimited Long Distance only $29.95/ month!
Sign Up Today! www.netzerolongdistance.com

Reply to this message...
 
    
Eric Landes (VIP)
Thanks li. It now is working, I was looping through a next statement, =
which
was only adding one <br> instead of the number I needed. This solves =
that
problem.

Eric

-----Original Message-----
From: li [mailto:Click here to reveal e-mail address]
Sent: Sunday, August 18, 2002 7:26 PM
To: aspngvb
Subject: [aspngvb] RE: Dynamically Adding Controls to an aspx page

use it,It works for me

Controls.Add(new literalControl("<br>"))

----- Original Message -----=20
From: "Jason Peterson" <Click here to reveal e-mail address>
To: "aspngvb" <Click here to reveal e-mail address>
Sent: Thursday, August 15, 2002 4:16 PM
Subject: [aspngvb] RE: Dynamically Adding Controls to an aspx page

Is your page's form set to GridLayout? I think you want FlowLayout.
Also, you can try two breaks "<BR><BR>" or a paragraph "<P></P>".

-----Original Message-----
From: Eric Landes [mailto:Click here to reveal e-mail address]=20
Sent: Thursday, 15 August, 2002 7:33 AM
To: aspngvb
Subject: [aspngvb] Dynamically Adding Controls to an aspx page

Folks,
I currently have a page set up that dynamically adds controls to a web
page
(textbox, and calendars, also labels). The controls are adding
correctly. =20

My issue is placement. Basically I place a label, then the textbox, or
calendar control after the label. I want a line break between each of
these, but have not figured out how to do this. Any ideas? I tried
creating a literal with "<br>" as the text, but that doesnt work. Below
is
the code:

dim oEntry as new textbox()
dim oLiteral as literal()
dim oLabel as new Label()

oliteral.Text =3D "<br>"
Controls.Add(oLabel)
Controls.Add(oLiteral)
Controls.Add(oEntry)
Controls.Add(oLiteral)

The label still displays on the same line as the textbox.
Any ideas? TIA

| [aspngvb] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp =3D JOIN/QUIT

-------------------------------------------
Introducing NetZero Long Distance
Unlimited Long Distance only $29.95/ month!
Sign Up Today! www.netzerolongdistance.com

| [aspngvb] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp =3D JOIN/QUIT

Confidentiality Notice: This e-mail message, including any
attachments, is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not
the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message.

PARTNERS Health Plan Phone: 574-233-4899
100 E. Wayne St., Suite 502 Fax: 574-234-7484
South Bend, IN 46601 www.partnersindiana.com

Reply to this message...
 
    
Kanwar, Gurpreet
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--------------InterScan_NT_MIME_Boundary
Content-Type: multipart/alternative;
    boundary="----_=_NextPart_001_01C2478E.1BD37EEE"

------_=_NextPart_001_01C2478E.1BD37EEE
Content-Type: text/plain;
    charset="iso-8859-1"

Visit www.4guysfromrolls.com for Dynamically Adding Controls

-----Original Message-----
From: Eric Landes [mailto:Click here to reveal e-mail address]
Sent: Monday, August 19, 2002 10:26 AM
To: aspngvb
Subject: [aspngvb] RE: Dynamically Adding Controls to an aspx page

Thanks li. It now is working, I was looping through a next statement, which
was only adding one <br> instead of the number I needed. This solves that
problem.

Eric

-----Original Message-----
From: li [mailto:Click here to reveal e-mail address]
Sent: Sunday, August 18, 2002 7:26 PM
To: aspngvb
Subject: [aspngvb] RE: Dynamically Adding Controls to an aspx page

use it,It works for me

Controls.Add(new literalControl("<br>"))

----- Original Message -----
From: "Jason Peterson" <Click here to reveal e-mail address>
To: "aspngvb" <Click here to reveal e-mail address>
Sent: Thursday, August 15, 2002 4:16 PM
Subject: [aspngvb] RE: Dynamically Adding Controls to an aspx page

Is your page's form set to GridLayout? I think you want FlowLayout.
Also, you can try two breaks "<BR><BR>" or a paragraph "<P></P>".

-----Original Message-----
From: Eric Landes [mailto:Click here to reveal e-mail address]
Sent: Thursday, 15 August, 2002 7:33 AM
To: aspngvb
Subject: [aspngvb] Dynamically Adding Controls to an aspx page

Folks,
I currently have a page set up that dynamically adds controls to a web
page
(textbox, and calendars, also labels). The controls are adding
correctly.

My issue is placement. Basically I place a label, then the textbox, or
calendar control after the label. I want a line break between each of
these, but have not figured out how to do this. Any ideas? I tried
creating a literal with "<br>" as the text, but that doesnt work. Below
is
the code:

dim oEntry as new textbox()
dim oLiteral as literal()
dim oLabel as new Label()

oliteral.Text = "<br>"
Controls.Add(oLabel)
Controls.Add(oLiteral)
Controls.Add(oEntry)
Controls.Add(oLiteral)

The label still displays on the same line as the textbox.
Any ideas? TIA

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

-------------------------------------------
Introducing NetZero Long Distance
Unlimited Long Distance only $29.95/ month!
Sign Up Today! www.netzerolongdistance.com

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

Confidentiality Notice: This e-mail message, including any
attachments, is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not
the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message.

PARTNERS Health Plan Phone: 574-233-4899
100 E. Wayne St., Suite 502 Fax: 574-234-7484
South Bend, IN 46601 www.partnersindiana.com

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

------_=_NextPart_001_01C2478E.1BD37EEE
Content-Type: text/html;
    charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2650.12">
<TITLE>RE: [aspngvb] RE: Dynamically Adding Controls to an aspx page</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Visit www.4guysfromrolls.com for Dynamically Adding Controls </FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Eric Landes [<A HREF="mailto:Click here to reveal e-mail address">mailto:Click here to reveal e-mail address</A>]</FONT>
<BR><FONT SIZE=2>Sent: Monday, August 19, 2002 10:26 AM</FONT>
<BR><FONT SIZE=2>To: aspngvb</FONT>
<BR><FONT SIZE=2>Subject: [aspngvb] RE: Dynamically Adding Controls to an aspx page</FONT>
</P>
<BR>

<P><FONT SIZE=2>Thanks li.  It now is working, I was looping through a next statement, which</FONT>
<BR><FONT SIZE=2>was only adding one <br> instead of the number I needed.  This solves that</FONT>
<BR><FONT SIZE=2>problem.</FONT>
</P>

<P><FONT SIZE=2>Eric</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: li [<A HREF="mailto:Click here to reveal e-mail address">mailto:Click here to reveal e-mail address</A>]</FONT>
<BR><FONT SIZE=2>Sent: Sunday, August 18, 2002 7:26 PM</FONT>
<BR><FONT SIZE=2>To: aspngvb</FONT>
<BR><FONT SIZE=2>Subject: [aspngvb] RE: Dynamically Adding Controls to an aspx page</FONT>
</P>
<BR>

<P><FONT SIZE=2>use it,It works for me</FONT>
</P>

<P><FONT SIZE=2>Controls.Add(new literalControl("<br>"))</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=2>----- Original Message ----- </FONT>
<BR><FONT SIZE=2>From: "Jason Peterson" <Click here to reveal e-mail address></FONT>
<BR><FONT SIZE=2>To: "aspngvb" <Click here to reveal e-mail address></FONT>
<BR><FONT SIZE=2>Sent: Thursday, August 15, 2002 4:16 PM</FONT>
<BR><FONT SIZE=2>Subject: [aspngvb] RE: Dynamically Adding Controls to an aspx page</FONT>
</P>
<BR>

<P><FONT SIZE=2>Is your page's form set to GridLayout?  I think you want FlowLayout.</FONT>
<BR><FONT SIZE=2>Also, you can try two breaks "<BR><BR>" or a paragraph "<P></P>".</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Eric Landes [<A HREF="mailto:Click here to reveal e-mail address">mailto:Click here to reveal e-mail address</A>] </FONT>
<BR><FONT SIZE=2>Sent: Thursday, 15 August, 2002 7:33 AM</FONT>
<BR><FONT SIZE=2>To: aspngvb</FONT>
<BR><FONT SIZE=2>Subject: [aspngvb] Dynamically Adding Controls to an aspx page</FONT>
</P>
<BR>

<P><FONT SIZE=2>Folks,</FONT>
<BR><FONT SIZE=2>I currently have a page set up that dynamically adds controls to a web</FONT>
<BR><FONT SIZE=2>page</FONT>
<BR><FONT SIZE=2>(textbox, and calendars, also labels).  The controls are adding</FONT>
<BR><FONT SIZE=2>correctly.  </FONT>
</P>

<P><FONT SIZE=2>My issue is placement.  Basically I place a label, then the textbox, or</FONT>
<BR><FONT SIZE=2>calendar control after the label.  I want a line break between each of</FONT>
<BR><FONT SIZE=2>these, but have not figured out how to do this.  Any ideas?  I tried</FONT>
<BR><FONT SIZE=2>creating a literal with "<br>" as the text, but that doesnt work.  Below</FONT>
<BR><FONT SIZE=2>is</FONT>
<BR><FONT SIZE=2>the code:</FONT>
</P>

<P><FONT SIZE=2>dim oEntry as new textbox()</FONT>
<BR><FONT SIZE=2>dim oLiteral as literal()</FONT>
<BR><FONT SIZE=2>dim oLabel as new Label()</FONT>
</P>

<P><FONT SIZE=2>oliteral.Text = "<br>"</FONT>
<BR><FONT SIZE=2>Controls.Add(oLabel)</FONT>
<BR><FONT SIZE=2>Controls.Add(oLiteral)</FONT>
<BR><FONT SIZE=2>Controls.Add(oEntry)</FONT>
<BR><FONT SIZE=2>Controls.Add(oLiteral)</FONT>
</P>
<BR>

<P><FONT SIZE=2>The label still displays on the same line as the textbox.</FONT>
<BR><FONT SIZE=2>Any ideas?  TIA</FONT>
</P>
<BR>

<P><FONT SIZE=2>| [aspngvb] member Click here to reveal e-mail address = YOUR ID</FONT>
<BR><FONT SIZE=2>| <A HREF="http://www.asplists.com/asplists/aspngvb.asp" TARGET="_blank">http://www.asplists.com/asplists/aspngvb.asp</A> = JOIN/QUIT</FONT>
</P>
<BR>

<P><FONT SIZE=2>-------------------------------------------</FONT>
<BR><FONT SIZE=2>Introducing NetZero Long Distance</FONT>
<BR><FONT SIZE=2>Unlimited Long Distance only $29.95/ month!</FONT>
<BR><FONT SIZE=2>Sign Up Today! www.netzerolongdistance.com</FONT>
</P>

<P><FONT SIZE=2>| [aspngvb] member Click here to reveal e-mail address = YOUR ID</FONT>
<BR><FONT SIZE=2>| <A HREF="http://www.asplists.com/asplists/aspngvb.asp" TARGET="_blank">http://www.asplists.com/asplists/aspngvb.asp</A> = JOIN/QUIT</FONT>
</P>

<P><FONT SIZE=2>Confidentiality Notice: This e-mail message, including any</FONT>
<BR><FONT SIZE=2>attachments, is for the sole use of the intended recipient(s) and may</FONT>
<BR><FONT SIZE=2>contain confidential and privileged information.  Any unauthorized</FONT>
<BR><FONT SIZE=2>review, use, disclosure or distribution is prohibited.  If you are not</FONT>
<BR><FONT SIZE=2>the intended recipient, please contact the sender by reply e-mail and</FONT>
<BR><FONT SIZE=2>destroy all copies of the original message.</FONT>
</P>

<P><FONT SIZE=2>PARTNERS Health Plan                Phone: 574-233-4899</FONT>
<BR><FONT SIZE=2>100 E. Wayne St., Suite 502         Fax:      574-234-7484</FONT>
<BR><FONT SIZE=2>South Bend, IN 46601                www.partnersindiana.com</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=2>| [aspngvb] member Click here to reveal e-mail address = YOUR ID</FONT>
<BR><FONT SIZE=2>| <A HREF="http://www.asplists.com/asplists/aspngvb.asp" TARGET="_blank">http://www.asplists.com/asplists/aspngvb.asp</A> = JOIN/QUIT</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C2478E.1BD37EEE--

--------------InterScan_NT_MIME_Boundary--

Reply to this message...
 
 
System.Reflection.Emit.Label
System.Web.UI.MobileControls.Label
System.Web.UI.WebControls.Label
System.Windows.Forms.Label




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com