Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dynamic Textbox Style/Event

Posted on 2004-10-14
4
Medium Priority
?
576 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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

722 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