Display textbox with no border

T

tfs

I am trying to display some data that is about 200 characters long and
I was trying to display it on the screen in a textbox

<asp:textbox />

But I don't want any borders.

How would I display that?

Thanks,

Tom
 
T

Trevor Benedict R

See if this helps.
<html>
<head>
<style type="text/css">
<!--
input { font-family: Verdana, Arial, Helvetica, sans-serif; font-size:
10 px; color: #003068; text-decoration: none; background-color: #FFFFFF;
border-color: #88A0C8 #88A0C8 #88A0C8; border-style: solid;
border-top-width: 0 px; border-right-width: 0 px; border-bottom-width: 0
px; border-left-width: 0 px}
-->
</style>
</head>
<body>
<input type="text" value="Some Text Here"></input>
</body>
</html>

Won't you be confusing the User with this technique. Check out the Label
Control if required.

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
T

tfs

That almost works (style="border:none") as does borderstyle="None".
But it doesn't get rid of the scrollbar on the left. The border is
gone but there is this scroll bar sitting out on the right (even
though there is nothing to scroll). I have it set to 5 rows and
there is only 2 or 3 rows displaying.

I have a similar problem with my dropdownlist. I have the border set
to none and it still shows the drop down box. I only want to show
the selected item and no border.

Here is code where I set them as well as the objects:

<script runat="server">
...
description.text = objDataReader("description")
recurrance.SelectedIndex =
objDataReader("recurrance")
...
</script>

<asp:textbox style="border:None"
id="description" TextMode="Multiline"
Columns="50" Rows="5" runat="server"
/>


<asp:dropdownlist borderstyle="None"
id="recurrance" runat="server">
<asp:listitem value="0"
None</asp:listitem> <asp:listitem value="1"
Daily</asp:listitem> <asp:listitem value="2"
Weekly</asp:listitem> <asp:listitem value="3"
Monthly</asp:listitem> <asp:listitem value="4"
Yearly</asp:listitem>
</asp:dropdownlist>


Thanks,

Tom.
 
T

Trevor Benedict R

Here it is. Tested only on IE 5.5 & 6.0

textarea {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10 px;
color: #003068;
text-decoration: none;
background-color: #FFFFFF;
border-top-width: 0 px; border-right-width: 0 px; border-bottom-width:
0px; border-left-width: 0 px;
SCROLLBAR-FACE-COLOR: white;
SCROLLBAR-HIGHLIGHT-COLOR: white;
SCROLLBAR-SHADOW-COLOR: white;
SCROLLBAR-3DLIGHT-COLOR: white;
SCROLLBAR-ARROW-COLOR: white;
SCROLLBAR-TRACK-COLOR: white;
SCROLLBAR-DARKSHADOW-COLOR: white;
SCROLLBAR-BASE-COLOR:white;}

Regards

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
T

tfs

Interesting.

You actually didn't get rid of the scrollbar, just made all the parts
the same color as the background (in this case, white).

The problem with this would be that all the text boxes would have this
applied.

I just changed the "textarea" to .noscrolltextarea and put the class
in the <td> like so:


<tr valign="baseline">
<td nowrap align="right"
valign="top">Description:</td>
<td>
<asp:textbox class="noscrolltextarea"
id="description" TextMode="Multiline"
Columns="50" Rows="5" runat="server"
/>
</td>
</tr>


I am curious why the textarea works for the textbox (wouldn't you need
to use textbox?).

I still couldn't get the dropdownlist to hide the border and just show
the selected text so I just hid the dropdownlist control, set the
selected area and moved it to a label control. There may be a better
way, but this works.

[code:1:c24f5c16f8]
recurrenceType.SelectedValue =
objDataReader("recurrenceType")
recurrenceDisplay.text = recurrenceType.SelectedItem.text

<td nowrap align="right">Recurrance:</td>
<td>
<asp:label id="recurrenceDisplay"
runat="server" />
<asp:dropdownlist style="visibility:hidden"
id="recurrenceType" runat="server">
<asp:listitem value="N"
None</asp:listitem> <asp:listitem value="M"
Monthly</asp:listitem> <asp:listitem value="P"
Periodic</asp:listitem>
</asp:dropdownlist>
</td>
[/code:1:c24f5c16f8]


Thanks,

Tom
 
T

Trevor Benedict R

I used the stylesheet for the TEXTAREA b'cos, the ASP.NET TextBox gets
rendered as a Input Tag when you set the TextMode to SingleLine and as a
textArea when you set it to MultiLine. There is another option called
Password.

NOTHING HAS CHANGED IN HTML. So it is still the same <INPUT>,
<TEXTAREA>, <DIV>, <TABLE> etc that you see as controls on the Server.
With a little hack you can achieve what you want.

If you do a viewsource in IE, you can see what is really happening.

Regards,

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

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
474,262
Messages
2,571,043
Members
48,769
Latest member
Clifft

Latest Threads

Top