CSS and html
id0 is the class for the div that received the background as a sprite image and inside this div .. there is a list of links (in the repeater) .. when the user hovered over the links .. the background image div displays diff parts of the sprite respectively
Now I want the id1-id5 classes to be set as relay list classes ... now, how can I get away from it?
like the list of links inside the repeater, comes from the database. How can I create div tags inside this repeater
and how to install a class for each of the 5 sections that will be created, and install these classes on them?
as before, I had simple markup, but now I need to generate this list of links using a relay .. how do I apply CSS now?
Please give some ideas ..thnx
[EDIT] OK tried this .. added the div tag in the repeater after the label and in the code behind: - rpt1.FindControl ("myDiv"). Controls.Add (class = ??) // what to enter here to use for a loop or what? [edit] this does not work .. is something wrong? **
for(int i=1;i<6;i++) { rpt1.FindControl("myDiv").Controls.Add("class=id[i]"); }
The above error: -
The best overloaded method match for "System.Web.UI.ControlCollection.Add (System.Web.UI.Control)" contains some invalid arguments
Now how to set classes for div?
pch..made dilly error..changed changes ..
for (int i = 1; i < 6; i++) { string divClass = "id"; rpt1.FindControl("myDiv").Controls.Add("class=id" + i); }
still the same mistakes.
[edit]
tried the following .. doesn't work
rpt1.FindControl("myDiv").Attributes.Add("class","id" +i);
[edit]
I tried the following:
rpt1.FindControl("myDiv").Attributes["class"] = "id" + i;
he says: "Cannot apply indexing with [] to an expression like" method group "" ???