473,320 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

change border of asp:textbox with stylesheet

I want to change the border of a asp.net textbox to thin-solid-blue but when
I set the cssclass property to a class in the stylesheet, the border
properties in the stylesheet don't have any effect on the textbox's
appearance. however if I write a style attribute into the textbox tag like
the sample below the border looks like I want:
style="BORDER-RIGHT:steelblue 1px solid; BORDER-TOP:steelblue 1px solid;
BORDER-LEFT:steelblue 1px solid; WIDTH:202px; BORDER-BOTTOM:steelblue 1px
solid"

How can I achieve this by just using the stylesheet?

Here's the class in the stylesheet:
clsLgnTxBx
{
border-right: steelblue 1px solid;
border-top: steelblue 1px solid;
border-left: steelblue 1px solid;
border-bottom: steelblue 1px solid;
}
--
mo*******@nospam.com
Nov 18 '05 #1
2 8031
Thanks Steven. That must have sounded like a dumb question and I appreciate
all the work you put into your responses!!! I did in fact use the CssClass
attribute and not the Class attribute but for some reason it wasn't taking
effect. Well I had a lot going on yesterday in this project and it looks
like something got jammed up in VS or somewhere else because when I rebooted
this morning the asp.net textboxes were recognizing the style and had the
appearance I was trying to achieve. I don't know why it started working
after the reboot, but, I guess its just one of those things... meanwhile it
made me look pretty silly. Sorry :(

--
mo*******@nospam.com
"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:aB***************@cpmsftngxa06.phx.gbl...
Hi Moondaddy,
Thanks for posting in the community!
Based on my understanding, you have a certain ASP.NET web page which linked another css style sheet file. And you want to apply some css classes in the css file on some certain textboxes on the page, yes?

As for this question, here is my suggestions:
1. If you want to apply css classe on html element, you can use the "class" attribute of the html element, For example:
<INPUT id="txtHtml" type="text" class="clsLgnTxBx" />

2. If you want to apply css class on a certain ASP.NET server control, you
can via its "cssclass" attribute, such as:
<asp:TextBox id="txtASPNET" runat="server"
CssClass="clsLgnTxBx"></asp:TextBox>

And I've attached an sample page and css file to show the above means.
Please check it out if you feel anything unclear.
Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #2
Hi Moondaddy,
Thanks for your followup. I'm glad that you've figured out the problem. I
think what you've met is likely caused by the client's cache since you used
a static css link file. So I recomment that you try refresh the client
browsr's cache when you meet the similar problem. Anyway, thanks again for
posting in community.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Alex | last post by:
I am a newbie to ASP.NET... What I was trying to do... but yet to succeed in... I am building a customer info database... and on default, I want to display the customer's basic information in...
2
by: Kerri | last post by:
Hi, I have an asp textbox that allows users to enter their password. I have another page that allows a user to edit their user account. On this page I set the text to be the password in...
1
by: Ed West | last post by:
Hello, How can I put a textbox control into a cell of an asp:Table? I was not able to do it from the properties sheet, so I put it in via html tab, but now I can't select it from the Design tab...
1
by: Shilpi Chaudhry | last post by:
I have a forloop which I use to create textboxes - but unfortunately all of them have the same ids - I need to assign different ids to these textboxes creeated in the loop so that I can retrieve...
0
by: Luis Esteban Valencia | last post by:
am trying to databind within an asp:textbox control. I have tried many variations found here but nothing seems to work. It works fine if I use a regular HTML textbox input though. Here is what I...
3
by: Patrick | last post by:
Try to put in a TextBox next month's date in format (MMM yyyy). The following does NOT work, why is that? <!--When rendered, the texbox is blank, although the text in the round bracket after the...
0
by: datakix | last post by:
After 16 hours of frustration, I've managed to solve this problem for a project I'm working on. The 'trick' is set EnableViewState="False" for the asp:textbox inside the Repeater control. The...
11
by: Joe | last post by:
Hello All, I have an ASP.NET page with one Textbox (SearchTextBox) and one ImageButton (SearchButton) server controls. The user can type search text in SearchTextBox and click SearchButton and...
0
by: CharlesA | last post by:
Hi folks, I'm using ASP.net 1.1 with C# I've got this kind of thing going <div class="row"> <label class="col1">Rm Name</label> <asp:textbox id="txtRM" runat="server" cssclass="col2"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.