positioning label+textbox in user control

T

ton

Hi,
i want to create a server-site usercontrol to logon a database: It should be
very simple but i cannot get the label en textbox in the write order. I want
domething like

Name : [ tekstbox]
Password [ tekstbox]

Button

as just one usercontrol

can someone help me

thanx

Ton
 
A

Alessandro Zifiglio

code the markup tags in the .ascx file, its just like working on a normal
aspx file with the exception that you cannot add <html><head><body> tags,
shouldnt be very difficult. If you are using vs.net then use the designer
and drag and drop controls into the page, couldnt get simpler ;)
 
T

ton

I'm sorry I do not understand it.
I can place these controls on the webform. But how can I call this form,
from what method or how look the code behind file to get a usercontrol (as a
DLL), which my customers could use.

can you explain this in more detail, or can you give me a link where this is
explained

Ton

Alessandro Zifiglio said:
code the markup tags in the .ascx file, its just like working on a normal
aspx file with the exception that you cannot add <html><head><body> tags,
shouldnt be very difficult. If you are using vs.net then use the designer
and drag and drop controls into the page, couldnt get simpler ;)

ton said:
Hi,
i want to create a server-site usercontrol to logon a database: It
should
be
very simple but i cannot get the label en textbox in the write order. I want
domething like

Name : [ tekstbox]
Password [ tekstbox]

Button

as just one usercontrol

can someone help me

thanx

Ton
 
A

Alessandro Zifiglio

All the basics for user control creating and usage are there on this
tutorial.

http://docs.aspng.com/quickstart/aspplus/doc/webpagelets.aspx


ton said:
I'm sorry I do not understand it.
I can place these controls on the webform. But how can I call this form,
from what method or how look the code behind file to get a usercontrol (as a
DLL), which my customers could use.

can you explain this in more detail, or can you give me a link where this is
explained

Ton

Alessandro Zifiglio said:
code the markup tags in the .ascx file, its just like working on a normal
aspx file with the exception that you cannot add <html><head><body> tags,
shouldnt be very difficult. If you are using vs.net then use the designer
and drag and drop controls into the page, couldnt get simpler ;)

ton said:
Hi,
i want to create a server-site usercontrol to logon a database: It
should
be
very simple but i cannot get the label en textbox in the write order.
I
want
domething like

Name : [ tekstbox]
Password [ tekstbox]

Button

as just one usercontrol

can someone help me

thanx

Ton
 
T

ton

i've read the article but I just can't get the txtbox en label positioning
the way i want it.
The control will not use the html in the .ascx -file

Do you have a (minor) working sample ?

thanks


Ton

Alessandro Zifiglio said:
All the basics for user control creating and usage are there on this
tutorial.

http://docs.aspng.com/quickstart/aspplus/doc/webpagelets.aspx


ton said:
I'm sorry I do not understand it.
I can place these controls on the webform. But how can I call this form,
from what method or how look the code behind file to get a usercontrol
(as
a
DLL), which my customers could use.

can you explain this in more detail, or can you give me a link where
this
is
explained

Ton

"Alessandro Zifiglio" <[email protected]> schreef in
bericht news:[email protected]...
order.
I
want
domething like

Name : [ tekstbox]
Password [ tekstbox]

Button

as just one usercontrol

can someone help me

thanx

Ton
 
T

ton

Thank you for your last comment
I do not write a usercontrol since the source of a usercontrol can be
editted by the user, its part of the project. Instead I want to write my own
Custom Servercontrol:

a login dialog. My client gets a DLL which and he can use the custom server
controls on his html page.

I hope you understand what I'm meaning

Ton


Alessandro Zifiglio said:
All the basics for user control creating and usage are there on this
tutorial.

http://docs.aspng.com/quickstart/aspplus/doc/webpagelets.aspx


ton said:
I'm sorry I do not understand it.
I can place these controls on the webform. But how can I call this form,
from what method or how look the code behind file to get a usercontrol
(as
a
DLL), which my customers could use.

can you explain this in more detail, or can you give me a link where
this
is
explained

Ton

"Alessandro Zifiglio" <[email protected]> schreef in
bericht news:[email protected]...
order.
I
want
domething like

Name : [ tekstbox]
Password [ tekstbox]

Button

as just one usercontrol

can someone help me

thanx

Ton
 
A

Alessandro Zifiglio

hi Ton, the reason i said code the markup in your usercontrol is because you
explicitly stated that you wanted to control placement of Items in your
"UserControl".

Ok, if this is a custom web control, in your CreateChildControls method as
you add your controls that is label + textboxes one of the simplest ways to
go about markup is to try adding them into a table control.

Protected Overrides Sub CreateChildControls()

Dim table As New table()
table.ID = ClientID & "_table"
Controls.Add(table)

Dim r1 As New TableRow()
Dim r2 As New TableRow()
Dim c1 As New TableCell()
Dim c2 As New TableCell()
Dim c3 As New TableCell()
Dim c4 As New TableCell()

c1.controls.add(label1)
c2.controls.add(textbox1)
r1.cells.add(c1)
r1.cells.add(c2)

label1.id = clientID & "_lblusername"
label1.text = "Username:"
textbox1.id = clientID & "_txtusername"


c3.controls.add(label2)
c4.controls.add(textbox2)
r2.cells.add(c3)
r2.cells.add(c4)

'set properties after adding the control to the controls collection
lable2.id = clientID & "_password"
label2.text = "Password:"
textbox1.id = clientID & "_txtpassword"

'now add your two rows to the table
table.rows.add(r1)
table.rows.add(r2)

End sub

this will give you the format :

username : ----------

password : ----------

You can further set fixed styling to the table or expose style as a property
of your control that way you can set it from the properties grid just like
with any web control.

ton said:
Thank you for your last comment
I do not write a usercontrol since the source of a usercontrol can be
editted by the user, its part of the project. Instead I want to write my own
Custom Servercontrol:

a login dialog. My client gets a DLL which and he can use the custom server
controls on his html page.

I hope you understand what I'm meaning

Ton


Alessandro Zifiglio said:
All the basics for user control creating and usage are there on this
tutorial.

http://docs.aspng.com/quickstart/aspplus/doc/webpagelets.aspx


ton said:
I'm sorry I do not understand it.
I can place these controls on the webform. But how can I call this form,
from what method or how look the code behind file to get a usercontrol
(as
a
DLL), which my customers could use.

can you explain this in more detail, or can you give me a link where
this
is
explained

Ton

"Alessandro Zifiglio" <[email protected]> schreef in
bericht code the markup tags in the .ascx file, its just like working on a normal
aspx file with the exception that you cannot add <html><head><body> tags,
shouldnt be very difficult. If you are using vs.net then use the designer
and drag and drop controls into the page, couldnt get simpler ;)

Hi,
i want to create a server-site usercontrol to logon a database: It
should
be
very simple but i cannot get the label en textbox in the write
order.
I
want
domething like

Name : [ tekstbox]
Password [ tekstbox]

Button

as just one usercontrol

can someone help me

thanx

Ton
 
T

ton

thank you very much, this works fine

ton
Alessandro Zifiglio said:
hi Ton, the reason i said code the markup in your usercontrol is because you
explicitly stated that you wanted to control placement of Items in your
"UserControl".

Ok, if this is a custom web control, in your CreateChildControls method as
you add your controls that is label + textboxes one of the simplest ways to
go about markup is to try adding them into a table control.

Protected Overrides Sub CreateChildControls()

Dim table As New table()
table.ID = ClientID & "_table"
Controls.Add(table)

Dim r1 As New TableRow()
Dim r2 As New TableRow()
Dim c1 As New TableCell()
Dim c2 As New TableCell()
Dim c3 As New TableCell()
Dim c4 As New TableCell()

c1.controls.add(label1)
c2.controls.add(textbox1)
r1.cells.add(c1)
r1.cells.add(c2)

label1.id = clientID & "_lblusername"
label1.text = "Username:"
textbox1.id = clientID & "_txtusername"


c3.controls.add(label2)
c4.controls.add(textbox2)
r2.cells.add(c3)
r2.cells.add(c4)

'set properties after adding the control to the controls collection
lable2.id = clientID & "_password"
label2.text = "Password:"
textbox1.id = clientID & "_txtpassword"

'now add your two rows to the table
table.rows.add(r1)
table.rows.add(r2)

End sub

this will give you the format :

username : ----------

password : ----------

You can further set fixed styling to the table or expose style as a property
of your control that way you can set it from the properties grid just like
with any web control.

ton said:
Thank you for your last comment
I do not write a usercontrol since the source of a usercontrol can be
editted by the user, its part of the project. Instead I want to write my own
Custom Servercontrol:

a login dialog. My client gets a DLL which and he can use the custom server
controls on his html page.

I hope you understand what I'm meaning

Ton


"Alessandro Zifiglio" <[email protected]> schreef in
bericht news:[email protected]...
All the basics for user control creating and usage are there on this
tutorial.

http://docs.aspng.com/quickstart/aspplus/doc/webpagelets.aspx


I'm sorry I do not understand it.
I can place these controls on the webform. But how can I call this form,
from what method or how look the code behind file to get a
usercontrol
(as
a
DLL), which my customers could use.

can you explain this in more detail, or can you give me a link where this
is
explained

Ton

"Alessandro Zifiglio" <[email protected]>
schreef
in
bericht code the markup tags in the .ascx file, its just like working on a
normal
aspx file with the exception that you cannot add
tags,
shouldnt be very difficult. If you are using vs.net then use the
designer
and drag and drop controls into the page, couldnt get simpler ;)

Hi,
i want to create a server-site usercontrol to logon a database: It
should
be
very simple but i cannot get the label en textbox in the write order.
I
want
domething like

Name : [ tekstbox]
Password [ tekstbox]

Button

as just one usercontrol

can someone help me

thanx

Ton
 
A

Alessandro Zifiglio

your welcome ton ;)
ton said:
thank you very much, this works fine

ton
Alessandro Zifiglio said:
hi Ton, the reason i said code the markup in your usercontrol is because you
explicitly stated that you wanted to control placement of Items in your
"UserControl".

Ok, if this is a custom web control, in your CreateChildControls method as
you add your controls that is label + textboxes one of the simplest ways to
go about markup is to try adding them into a table control.

Protected Overrides Sub CreateChildControls()

Dim table As New table()
table.ID = ClientID & "_table"
Controls.Add(table)

Dim r1 As New TableRow()
Dim r2 As New TableRow()
Dim c1 As New TableCell()
Dim c2 As New TableCell()
Dim c3 As New TableCell()
Dim c4 As New TableCell()

c1.controls.add(label1)
c2.controls.add(textbox1)
r1.cells.add(c1)
r1.cells.add(c2)

label1.id = clientID & "_lblusername"
label1.text = "Username:"
textbox1.id = clientID & "_txtusername"


c3.controls.add(label2)
c4.controls.add(textbox2)
r2.cells.add(c3)
r2.cells.add(c4)

'set properties after adding the control to the controls collection
lable2.id = clientID & "_password"
label2.text = "Password:"
textbox1.id = clientID & "_txtpassword"

'now add your two rows to the table
table.rows.add(r1)
table.rows.add(r2)

End sub

this will give you the format :

username : ----------

password : ----------

You can further set fixed styling to the table or expose style as a property
of your control that way you can set it from the properties grid just like
with any web control.

my
own
database:
It
should
be
very simple but i cannot get the label en textbox in the write
order.
I
want
domething like

Name : [ tekstbox]
Password [ tekstbox]

Button

as just one usercontrol

can someone help me

thanx

Ton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top