Solved

Dynamic Textbox Style/Event

Posted on 2004-10-14
4
571 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
  • 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

785 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