positioning label+textbox in user control

Discussion in 'ASP .Net Building Controls' started by ton, Jan 15, 2004.

  1. ton

    ton Guest

    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
    ton, Jan 15, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:bu6c7r$s3m$1.nb.home.nl...
    > 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
    >
    >
    Alessandro Zifiglio, Jan 15, 2004
    #2
    1. Advertising

  3. ton

    ton Guest

    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" <> schreef in
    bericht news:wOyNb.3548$...
    > 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" <> wrote in message
    > news:bu6c7r$s3m$1.nb.home.nl...
    > > 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
    > >
    > >

    >
    >
    ton, Jan 15, 2004
    #3
  4. All the basics for user control creating and usage are there on this
    tutorial.

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


    "ton" <> wrote in message
    news:bu6f4r$mfi$1.nb.home.nl...
    > 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" <> schreef in
    > bericht news:wOyNb.3548$...
    > > 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" <> wrote in message
    > > news:bu6c7r$s3m$1.nb.home.nl...
    > > > 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
    > > >
    > > >

    > >
    > >

    >
    >
    Alessandro Zifiglio, Jan 15, 2004
    #4
  5. ton

    ton Guest

    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" <> schreef in
    bericht news:MNBNb.3597$...
    > All the basics for user control creating and usage are there on this
    > tutorial.
    >
    > http://docs.aspng.com/quickstart/aspplus/doc/webpagelets.aspx
    >
    >
    > "ton" <> wrote in message
    > news:bu6f4r$mfi$1.nb.home.nl...
    > > 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" <> schreef

    in
    > > bericht news:wOyNb.3548$...
    > > > 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" <> wrote in message
    > > > news:bu6c7r$s3m$1.nb.home.nl...
    > > > > 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
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    ton, Jan 17, 2004
    #5
  6. ton

    ton Guest

    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" <> schreef in
    bericht news:MNBNb.3597$...
    > All the basics for user control creating and usage are there on this
    > tutorial.
    >
    > http://docs.aspng.com/quickstart/aspplus/doc/webpagelets.aspx
    >
    >
    > "ton" <> wrote in message
    > news:bu6f4r$mfi$1.nb.home.nl...
    > > 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" <> schreef

    in
    > > bericht news:wOyNb.3548$...
    > > > 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" <> wrote in message
    > > > news:bu6c7r$s3m$1.nb.home.nl...
    > > > > 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
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    ton, Jan 21, 2004
    #6
  7. 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" <> wrote in message
    news:bulhm3$88p$1.nb.home.nl...
    > 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" <> schreef in
    > bericht news:MNBNb.3597$...
    > > All the basics for user control creating and usage are there on this
    > > tutorial.
    > >
    > > http://docs.aspng.com/quickstart/aspplus/doc/webpagelets.aspx
    > >
    > >
    > > "ton" <> wrote in message
    > > news:bu6f4r$mfi$1.nb.home.nl...
    > > > 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" <> schreef

    > in
    > > > bericht news:wOyNb.3548$...
    > > > > 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" <> wrote in message
    > > > > news:bu6c7r$s3m$1.nb.home.nl...
    > > > > > 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
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Alessandro Zifiglio, Jan 21, 2004
    #7
  8. ton

    ton Guest

    thank you very much, this works fine

    ton
    "Alessandro Zifiglio" <> schreef in
    bericht news:4ytPb.5882$...
    > 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" <> wrote in message
    > news:bulhm3$88p$1.nb.home.nl...
    > > 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" <> schreef

    in
    > > bericht news:MNBNb.3597$...
    > > > All the basics for user control creating and usage are there on this
    > > > tutorial.
    > > >
    > > > http://docs.aspng.com/quickstart/aspplus/doc/webpagelets.aspx
    > > >
    > > >
    > > > "ton" <> wrote in message
    > > > news:bu6f4r$mfi$1.nb.home.nl...
    > > > > 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" <>

    schreef
    > > in
    > > > > bericht news:wOyNb.3548$...
    > > > > > 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" <> wrote in message
    > > > > > news:bu6c7r$s3m$1.nb.home.nl...
    > > > > > > 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
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    ton, Jan 22, 2004
    #8
  9. your welcome ton ;)
    "ton" <> wrote in message
    news:buofqi$564$1.nb.home.nl...
    > thank you very much, this works fine
    >
    > ton
    > "Alessandro Zifiglio" <> schreef in
    > bericht news:4ytPb.5882$...
    > > 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" <> wrote in message
    > > news:bulhm3$88p$1.nb.home.nl...
    > > > 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" <> schreef

    > in
    > > > bericht news:MNBNb.3597$...
    > > > > All the basics for user control creating and usage are there on this
    > > > > tutorial.
    > > > >
    > > > > http://docs.aspng.com/quickstart/aspplus/doc/webpagelets.aspx
    > > > >
    > > > >
    > > > > "ton" <> wrote in message
    > > > > news:bu6f4r$mfi$1.nb.home.nl...
    > > > > > 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" <>

    > schreef
    > > > in
    > > > > > bericht news:wOyNb.3548$...
    > > > > > > 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" <> wrote in message
    > > > > > > news:bu6c7r$s3m$1.nb.home.nl...
    > > > > > > > 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
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Alessandro Zifiglio, Jan 22, 2004
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. S. Justin Gengo
    Replies:
    0
    Views:
    520
    S. Justin Gengo
    Jul 16, 2003
  2. =?Utf-8?B?U2FuZHk=?=
    Replies:
    7
    Views:
    7,410
    =?Utf-8?B?U2FuZHk=?=
    Jul 10, 2005
  3. Label positioning

    , Aug 31, 2006, in forum: HTML
    Replies:
    1
    Views:
    317
    Jukka K. Korpela
    Aug 31, 2006
  4. Annie

    LABEL-TEXTBOX USER CONTROL

    Annie, Jun 9, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    145
    Annie
    Jun 9, 2006
  5. Knut Krueger
    Replies:
    8
    Views:
    265
    Knut Krueger
    Aug 20, 2013
Loading...

Share This Page