0

i need to assign a css class for a panel. because i need to display data from the data base without using grid view .so that i can display all the data in dynamic panels..

without using grid view is their any other way to do it,

       for (int i = 0; i < 9; i++)
                {
                     Panel k=new Panel();
                //(col-sm-4 col-lg-4 col-md-4) css call wcich i need to add for this panel
                // add lable
                Panel2.Conrols.add(k);  
 }
0

1 Answer 1

1

You can change the CssClass property of the Panel to set the class, as shown in this answer How do you programmatically apply a css class to an asp.net control?

You can just do this:

 firstName.CssClass = "input left selected". 

If you want to append to any existing class names, do this:

 firstName.CssClass += " selected";
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.