【发布时间】:2013-08-06 19:34:53
【问题描述】:
在我的 DotNetNuke 网站上,我创建了一个模块,该模块使用数据表来显示我的组织成员希望出售的一些商品。 ItemName 列是指向名为 ItemView.aspx 的 aspx 项目的链接,此页面包含有关从父页面上的该链接或 dnn 模块上的 ItemName 列填充的项目的详细信息。这是链接:
<td><p><a href="http://www.mysite.com/traderboard/ItemView.aspx?ItemName=<%# Eval("ItemName") %>&num=<%# Eval("num") %>&ImageAlt1=<%# Eval("ImageAlt1") %>&ImageAlt2=<%# Eval("ImageAlt2") %>&ImageAlt3=<%# Eval("ImageAlt3") %>?iframe=true&width=800&height=600" style="border: 0px currentColor;" rel="prettyPhoto[iframes]"><%# Eval("ItemName") %></a>
如果用户决定上传任何给他提供链接的图片,则在 ItemView 页面(在 prettyPhoto iframe 中拉出)上一次。
这是我用来在我的.aspx 文件中填充特定用户图像的 jQuery sn-p:
$("#hplImageTest").click(function () {
$.fancybox.open([
{
href: '<%=Image1%>',
title: 'My title'
}, {
href: '<%=Image2%>',
title: '2nd title'
}, {
href: '<%=Image3%>'
}
], {
helpers: {
thumbs: {
width: 75,
height: 50
}
}
});
});
最后,我调用了位于ItemView 页面上的链接上的图像。
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
lblRow.Text = Request.QueryString["num"];
PostPath1 = Request.QueryString["ImageAlt1"];
PostPath2 = Request.QueryString["ImageAlt2"];
PostPath3 = Request.QueryString["ImageAlt3"];
Image1 = "http://www.mysite.com/" + PostPath1;
Image2 = "http://www.mysite.com/" + PostPath2;
Image3 = "http://www.mysite.com/" + PostPath3;
string empty = "../images/tbimages/noImage.jpg";
if ((PostPath1 == empty) && (PostPath2 == empty) && (PostPath3 == empty))
{
hplImageTest.Text = "No Images Available";
}
else
{
hplImageTest.NavigateUrl = "javascript:;";
hplImageTest.Text = "Click here for Image(s)";
}
}
}
它可以在 Firefox、Safari 和 Chrome 中运行,但在 IE 中什么也没有。有没有其他人遇到过这个问题?
【问题讨论】:
标签: c# jquery fancybox-2 image-gallery prettyphoto