Dynamic Textbox Style/Event

Posted on 2004-10-14
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?
Question by:FIM2003
  • 2
  • 2
LVL 15

Expert Comment

ID: 12309839
you can use


same way for border style...

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

Author Comment

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


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

Accepted Solution

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

try that

Author Comment

ID: 12310908
Thanks praneetha

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

932 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now