13.07.2015 Views

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

194<strong>ASP</strong>.<strong>NET</strong> <strong>3.5</strong>: A Beginner’s <strong>Guide</strong>Figure 7-19 Color <strong>com</strong>bination and color informationC# StyleIn addition to creating styles for your objects by using <strong>ASP</strong>.<strong>NET</strong>, you can also add styleclasses to web controls directly from C#. Suppose your style sheet is set, and you donot want to change it. However, a single Input form needs to be tweaked because theusers are entering nicknames instead of their given first names. For example, you needto have “James” instead of “Jim” and “Victoria” instead of “Torrie” to verify credit cardinformation. So rather than change your style sheet, you decide to add a little C# styling.The format isControlName.Style["css attribute"] = "css value";

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!