当前位置:编程学习 > C#/ASP.NET >>

asp.net题:图片路径问题

鼠标 停在图片上显示下边的这个路,多个引号 然后图片显示不出来,怎么回事呢? 

http://localhost:5399/Photo/PhotoImage/000.JPG"

代码是这样的:

foreach (DataRow dr in dt.Rows)
            {
                sb.Append("<div style=\"border:1px #dcdcdc solid; width:120px; text-align:center; float:left; padding-top:5px; height:85px; margin:10px;\"><a href=" + dr["imageUrl"].ToString() + "\" rel=\"lightbox[roadtrip]\" title=\"header=[↖相册] body=[++" + dr["imageName"] + "++]\"><img style=\"border:0px; width:110px; height:80px;\" src=" + dr["imageUrl"].ToString() + "\" /></a></div>");
                        }
            this.div_picture.InnerHtml = sb.ToString();

追问:我调试了,都得到了,也没问题,但是图片显示不出来,鼠标停在图片上,图的路径就是多了一个引号
答案:
sb.Append("<div style='border:1px #dcdcdc solid; width:120px; text-align:center; float:left; padding-top:5px; height:85px; margin:10px;'><a href=>
应该对了。你最后的 少了个引号好像。
存字符串里。来调试吧。这样太乱了。

上一个:ASP.net中DataList中获取值
下一个:asp.net 下from子句语法错误!

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,