Click here to Skip to main content
15,905,414 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Multilingual application Pin
bhattiprolu25-Oct-07 22:03
bhattiprolu25-Oct-07 22:03 
AnswerRe: Multilingual application Pin
Urs Enzler25-Oct-07 22:44
Urs Enzler25-Oct-07 22:44 
QuestionApply style to div tag. Pin
varshavmane25-Oct-07 20:39
varshavmane25-Oct-07 20:39 
AnswerRe: Apply style to div tag. Pin
Imran Khan Pathan25-Oct-07 20:44
Imran Khan Pathan25-Oct-07 20:44 
GeneralRe: Apply style to div tag. Pin
varshavmane25-Oct-07 21:20
varshavmane25-Oct-07 21:20 
GeneralRe: Apply style to div tag. Pin
Imran Khan Pathan25-Oct-07 21:28
Imran Khan Pathan25-Oct-07 21:28 
GeneralRe: Apply style to div tag. Pin
varshavmane25-Oct-07 21:47
varshavmane25-Oct-07 21:47 
AnswerRe: Apply style to div tag. Pin
SHatchard25-Oct-07 21:11
SHatchard25-Oct-07 21:11 
If you are adding styles I would suggest using a CSS class rather than explicity adding it in code, it makes it more managable and reusable

divtest.attributes.add("class", "myclass")

and then define in a CSS file myclass with the attributes you want

div.myclass
{
text-align: right;
display: none;
overflow: auto;
scrollbar-face-color : #ffffff;
scrollbar-highlight-color : #000000;
scrollbar-3dlight-color : #cccccc;
scrollbar-shadow-color : #000000;
scrollbar-darkshadow-color : #cccccc;
scrollbar-track-color : #cccccc;
scrollbar-arrow-color : #000000;
}

It also means you dont have to recompile if you need to make changes.

However, if you do need to apply it directly in code for some reason then i would suggest using the built in style property which can be strongly typed which is always nice, as follows

divtest.Style.Add(HtmlTextWriterStyle.TextAlign, "right")

or for ones which are not included in the strongly typed list use

divtest.Style.Add("scrollbar-face-color", "#000000")

Hope that helps




GeneralRe: Apply style to div tag. Pin
varshavmane25-Oct-07 21:21
varshavmane25-Oct-07 21:21 
GeneralRe: Apply style to div tag. Pin
SHatchard25-Oct-07 21:28
SHatchard25-Oct-07 21:28 
GeneralRe: Apply style to div tag. Pin
varshavmane25-Oct-07 21:40
varshavmane25-Oct-07 21:40 
GeneralRe: Apply style to div tag. Pin
SHatchard25-Oct-07 22:04
SHatchard25-Oct-07 22:04 
GeneralRe: Apply style to div tag. Pin
varshavmane25-Oct-07 22:56
varshavmane25-Oct-07 22:56 
QuestionAbout Media Player Pin
Kasi Viswanathan25-Oct-07 20:22
Kasi Viswanathan25-Oct-07 20:22 
AnswerRe: About Media Player Pin
N a v a n e e t h25-Oct-07 20:28
N a v a n e e t h25-Oct-07 20:28 
GeneralRe: About Media Player Pin
Kasi Viswanathan25-Oct-07 21:35
Kasi Viswanathan25-Oct-07 21:35 
AnswerRe: About Media Player Pin
Abhijit Jana25-Oct-07 21:04
professionalAbhijit Jana25-Oct-07 21:04 
GeneralRe: About Media Player Pin
Kasi Viswanathan25-Oct-07 21:37
Kasi Viswanathan25-Oct-07 21:37 
AnswerRe: About Media Player Pin
ngrj25-Oct-07 21:40
ngrj25-Oct-07 21:40 
GeneralRe: About Media Player Pin
Kasi Viswanathan25-Oct-07 21:58
Kasi Viswanathan25-Oct-07 21:58 
Questionmail server project Pin
shabi uz zaman25-Oct-07 19:55
shabi uz zaman25-Oct-07 19:55 
AnswerRe: mail server project Pin
N a v a n e e t h25-Oct-07 20:02
N a v a n e e t h25-Oct-07 20:02 
Questionaccessing remote desktops Pin
ssunny25-Oct-07 19:10
ssunny25-Oct-07 19:10 
AnswerRe: accessing remote desktops Pin
N a v a n e e t h25-Oct-07 19:52
N a v a n e e t h25-Oct-07 19:52 
QuestionHelp regarding master pages Pin
anu8125-Oct-07 19:02
anu8125-Oct-07 19:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.