Solved

Dynamic Textbox Style/Event

Posted on 2004-10-14
4
575 Views
Last Modified: 2012-06-27
I am dynamically creating textboxes in my ASP.NET page using VB.  How do I change the background color, borderstyle, and add the OnKeyUp event when creating the textboxes dynamically?
0
Comment
Question by:FIM2003
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 15

Expert Comment

by:praneetha
ID: 12309839
you can use

TextBox1.Attributes.Add("style","background-color:Red");

same way for border style...

TextBox1.Attributes.Add("OnKeyUp","javascript fn");
0
 

Author Comment

by:FIM2003
ID: 12309973
those work, however, when I set the background color and border, they overwrite each other


txtTextBox.Attributes.Add("style","background-color:'#C0C0C0'")
txtTextBox.Attributes.Add("style","border:None")

The border style overwrites the background color and vice-versa when the border is before the background line.
0
 
LVL 15

Accepted Solution

by:
praneetha earned 250 total points
ID: 12310040
txtTextBox.Attributes.Add("style","background-color:'#C0C0C0' ; border:None")

try that
0
 

Author Comment

by:FIM2003
ID: 12310908
Thanks praneetha
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question