Literal Control question

Discussion in 'ASP .Net' started by Mark A. Sam, Jun 22, 2006.

  1. Mark A. Sam

    Mark A. Sam Guest

    Hello,

    I want to use a literal control to provide information about people listed
    on a webpage, where the control is on the same line as the person it
    addresses, so that I have a button, the person's name, and the literal
    control on the same line. When the button is clicked it will populate or
    cleat the literal control.

    [+] John Smith []
    [+] Mary Jones []
    [-] Marv Johnson A Director. Came to the organization from Timbucktoo, Mo
    in August 1005. Has been in full time ministy for 25 years..... et.
    [+] Harry Oats []

    The ending brackets represent the literal control.

    My problem however is that I can't seen to get the text to move to the line
    below that name. Is that becuase A literal control won't allow a carrage
    return/line feed?

    Here is the code I used on the button:
    Protected Sub ShowRebecca_Click(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles ShowRebecca.Click

    If Literal1.Text = " " Then
    Literal1.Text = vbNewLine + " This is a test of using a " +
    vbNewLine + "literal control!"
    ShowRebecca.Text = "-" 'Set button caption
    Else
    Literal1.Text = " "
    ShowRebecca.Text = "+" 'Set button caption
    End If

    End Sub

    Any help here would be appreciated. I can move the literal control to the
    line below the name, but want to avoid spacing between the names.

    God Bless,

    Mark A. Sam
    Mark A. Sam, Jun 22, 2006
    #1
    1. Advertising

  2. Hi Mark,

    A Literal control should be populated with html code. So, instead of using a
    vbnewline or vbcrlf, use an html line break tag (<br>).

    Or, you could use a label control instead of the literal control. The label
    control understands things like vbcrlf, I beleive.

    Doug

    "Mark A. Sam" wrote:

    > Hello,
    >
    > I want to use a literal control to provide information about people listed
    > on a webpage, where the control is on the same line as the person it
    > addresses, so that I have a button, the person's name, and the literal
    > control on the same line. When the button is clicked it will populate or
    > cleat the literal control.
    >
    > [+] John Smith []
    > [+] Mary Jones []
    > [-] Marv Johnson A Director. Came to the organization from Timbucktoo, Mo
    > in August 1005. Has been in full time ministy for 25 years..... et.
    > [+] Harry Oats []
    >
    > The ending brackets represent the literal control.
    >
    > My problem however is that I can't seen to get the text to move to the line
    > below that name. Is that becuase A literal control won't allow a carrage
    > return/line feed?
    >
    > Here is the code I used on the button:
    > Protected Sub ShowRebecca_Click(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles ShowRebecca.Click
    >
    > If Literal1.Text = " " Then
    > Literal1.Text = vbNewLine + " This is a test of using a " +
    > vbNewLine + "literal control!"
    > ShowRebecca.Text = "-" 'Set button caption
    > Else
    > Literal1.Text = " "
    > ShowRebecca.Text = "+" 'Set button caption
    > End If
    >
    > End Sub
    >
    > Any help here would be appreciated. I can move the literal control to the
    > line below the name, but want to avoid spacing between the names.
    >
    > God Bless,
    >
    > Mark A. Sam
    >
    >
    >
    =?Utf-8?B?RG91ZyBTYWxvbW9u?=, Jun 22, 2006
    #2
    1. Advertising

  3. Mark A. Sam

    Mark A. Sam Guest

    Hello Doug,

    I tried a label with no better success, but the HTML worked. That looks
    like it could be a powerful tool Thanks for the tip.

    God Bless,

    Mark

    "Doug Salomon" <> wrote in message
    news:...
    > Hi Mark,
    >
    > A Literal control should be populated with html code. So, instead of using
    > a
    > vbnewline or vbcrlf, use an html line break tag (<br>).
    >
    > Or, you could use a label control instead of the literal control. The
    > label
    > control understands things like vbcrlf, I beleive.
    >
    > Doug
    >
    > "Mark A. Sam" wrote:
    >
    >> Hello,
    >>
    >> I want to use a literal control to provide information about people
    >> listed
    >> on a webpage, where the control is on the same line as the person it
    >> addresses, so that I have a button, the person's name, and the literal
    >> control on the same line. When the button is clicked it will populate or
    >> cleat the literal control.
    >>
    >> [+] John Smith []
    >> [+] Mary Jones []
    >> [-] Marv Johnson A Director. Came to the organization from Timbucktoo, Mo
    >> in August 1005. Has been in full time ministy for 25 years..... et.
    >> [+] Harry Oats []
    >>
    >> The ending brackets represent the literal control.
    >>
    >> My problem however is that I can't seen to get the text to move to the
    >> line
    >> below that name. Is that becuase A literal control won't allow a carrage
    >> return/line feed?
    >>
    >> Here is the code I used on the button:
    >> Protected Sub ShowRebecca_Click(ByVal sender As Object, ByVal e As
    >> System.EventArgs) Handles ShowRebecca.Click
    >>
    >> If Literal1.Text = " " Then
    >> Literal1.Text = vbNewLine + " This is a test of using a " +
    >> vbNewLine + "literal control!"
    >> ShowRebecca.Text = "-" 'Set button caption
    >> Else
    >> Literal1.Text = " "
    >> ShowRebecca.Text = "+" 'Set button caption
    >> End If
    >>
    >> End Sub
    >>
    >> Any help here would be appreciated. I can move the literal control to
    >> the
    >> line below the name, but want to avoid spacing between the names.
    >>
    >> God Bless,
    >>
    >> Mark A. Sam
    >>
    >>
    >>
    Mark A. Sam, Jun 22, 2006
    #3
    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. Mike Prager

    Re: Literal Control and Onclick?

    Mike Prager, Oct 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,138
    Mike Prager
    Oct 14, 2003
  2. NeilG
    Replies:
    0
    Views:
    522
    NeilG
    Jan 21, 2004
  3. Jk

    apply CSS on literal control?

    Jk, May 3, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    493
    Scott Mitchell [MVP]
    May 3, 2004
  4. Replies:
    0
    Views:
    296
  5. Anonieko Ramos

    What's wrong with rpc-literal? Why use doc-literal?

    Anonieko Ramos, Sep 27, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    355
    Anonieko Ramos
    Sep 27, 2004
Loading...

Share This Page