How to change the font style and size on the entire aspx page programatically

T

the.tinapatel

Guys,

I want the user to be able to select font (such as Bold, Italic,
underline) and stuff like that from a dropdown list) and then I wanna
apply these properties to all my page (all text). Now I'm doing
something like this:

string font = string.Empty;
switch(ddl2.SelectedItem.Text)
{
case "Bold":


font = Convert.ToString(System.Drawing.FontStyle.Bold);

break;

case "Italic":
font = Convert.ToString(System.Drawing.FontStyle.Italic);
break;

}
myBody.Attributes.Add("Font", font);
Session["theColor"] = font;

This worked for changing the color of the entire page as I hard coded
the colors hexa decimal values in the cases, but here these are enums,
and can only be compared.

Anyways does anyone has any input on this???? I want this to happen
when the user select from the DDL and on the button click event it
should change the font.

Thanks
Tina
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top