public void dispImgItems()
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite mySiteCollection = new SPSite(appSettings))
{
using (SPWeb web = mySiteCollection.OpenWeb())
{
SPList LstPicture = web.Lists["AnnPictureLibrary"];
List<ImageCollection> lsts = new List<ImageCollection>();
foreach (SPListItem item in LstPicture.Items)
{
if (item["Active"].ToString() == "Yes")
{
string ImageUrl = Convert.ToString(item["ows_EncodedAbsUrl"]);
string ImageName = Convert.ToString(item["Title"]);
lsts.Add(new ImageCollection(ImageUrl, ImageName));
}
}
//Image1.=
Image1.AlternateText = lsts[0].Name;
Image1.ImageUrl = lsts[0].URL;
Image1.Height = 400;
Image1.Width = 400;
}
}
});
}
}
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite mySiteCollection = new SPSite(appSettings))
{
using (SPWeb web = mySiteCollection.OpenWeb())
{
SPList LstPicture = web.Lists["AnnPictureLibrary"];
List<ImageCollection> lsts = new List<ImageCollection>();
foreach (SPListItem item in LstPicture.Items)
{
if (item["Active"].ToString() == "Yes")
{
string ImageUrl = Convert.ToString(item["ows_EncodedAbsUrl"]);
string ImageName = Convert.ToString(item["Title"]);
lsts.Add(new ImageCollection(ImageUrl, ImageName));
}
}
//Image1.=
Image1.AlternateText = lsts[0].Name;
Image1.ImageUrl = lsts[0].URL;
Image1.Height = 400;
Image1.Width = 400;
}
}
});
}
}
No comments:
Post a Comment