http://www.codeproject.com/KB/aspnet/ASPNET_Dynamic_Styling.aspx
add CSS classes in the mix ... will help in better management and multiple changes to a control ! On Feb 26, 8:39 pm, Jamie Fraser <[email protected]> wrote: > Hi Niti, > > You want to do something like > > btn.attributes.add("style", "background-color: #FF0000;"); > > On Fri, Feb 26, 2010 at 11:55 AM, Niti <[email protected]> wrote: > > Hi, > > This is Niti and im creating a dynamic web page, in that page im > > adding button dynamicaaly which is depedent on the user type, > > The problem im facing is i want to specify the style tag from code > > behind page. > > > Ex : > > Consider i m adding a button > > Button btn1 = new Button(); > > btn1.ID = "lnkEmp"; > > btn1.Text = "Employee"; > > Panel1.Controls.Add(btn1); > > > so after adding the controls i want to change the back color and > > border color of the button > > > Plz help me out if know the solutions and ur also welcome for some > > suggestion too > > > Regards > > Niti
