I created an image gallery very similar to the one in the demo for the RadRotator
(demo here) and the arrows for the rotator are appearing one and a half times on the top and bottom (see rotatorarrows.jpg). I am using the Forest skin. I have created the same rotator on a different website I built using the WebBlue skin and everything worked perfect. I assume it is some sort of CSS styling issue but I have no idea how to fix it. Help please!
public
partial
class
Controls_Photos : System.Web.UI.UserControl
{
private
string
_thumbPath =
"/thumbnails"
;
private
string
_fullImagePath =
"~/Images/photos"
;
[Serializable()]
private
struct
fileInfo
{
public
string
filename;
}
private
List<fileInfo> imagesArray
{
get
{
return
(List<fileInfo>)ViewState[
"imagesArray"
];
}
set
{
ViewState[
"imagesArray"
] = value;
}
}
public
string
ThumbPath
{
get
{
return
_thumbPath;
}
set
{
_thumbPath = value;
}
}
public
string
FullImagePath
{
get
{
return
_fullImagePath;
}
set
{
_fullImagePath = value;
}
}
protected
void
Page_Load(
object
sender, EventArgs e)
{
DataTable myTable = CreateDataTable();
if
(!IsPostBack ||
object
.Equals(imagesArray,
null
))
{
imagesArray =
new
List<fileInfo>();
foreach
(
string
fileName
in
System.IO.Directory.GetFiles(Server.MapPath(FullImagePath + ThumbPath),
"*thumb*"
))
//add functionality to sort by modified date
{
fileInfo fInfo =
new
fileInfo();
fInfo.filename = FullImagePath + ThumbPath +
"/"
+ fileName.Substring(fileName.LastIndexOf(
"\\"
) + 1);
imagesArray.Add(fInfo);
AddRow(
ref
myTable, fInfo.filename);
}
RadRotatorThumbs.DataSource = myTable.DefaultView;
RadRotatorThumbs.DataBind();
ImagePreview.ImageUrl = imagesArray[0].filename.Replace(
"_thumb"
,
""
).Replace(ThumbPath,
""
);
}
}
protected
DataTable CreateDataTable()
{
DataTable myTable =
new
DataTable();
DataColumn myColumn =
new
DataColumn();
myColumn.DataType = Type.GetType(
"System.String"
);
myColumn.ColumnName =
"ImageUrl"
;
myTable.Columns.Add(myColumn);
return
myTable;
}
protected
void
AddRow(
ref
DataTable myTable,
string
path)
{
DataRow myRow;
myRow = myTable.NewRow();
myRow[
"ImageUrl"
] = path;
myTable.Rows.Add(myRow);
}
protected
void
LoadImage(
object
sender, RadRotatorEventArgs e)
{
fileInfo fInfo = imagesArray[e.Item.Index];
ImagePreview.ImageUrl = fInfo.filename.Replace(
"_thumb"
,
""
).Replace(ThumbPath,
""
);
}
}