本文主要是介绍动态显示图片,并为hyperlink 做鼠标悬停效果,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
最近在给交通局忙一套好大的系统,到底有多大 ,呵呵 我也不知道,只是知道公司目前报价27万9 。第一次接这样大的活,并且从调研、到开发,都由我一个人主持 。呵呵 压力好大。经过了4个多月的调研,这套系统终于开始投入开发,准备在8月底,软件初步完成,交交通局试用。记录下,记录下在这套系统开中遇到的问题,以及解决方法,供自己和大家参考!
下面是一个遇到的小问题,动态显示图片,并动态添加鼠标悬停效果
代码如下:
cs文件代码如下:
下面是一个遇到的小问题,动态显示图片,并动态添加鼠标悬停效果
代码如下:
< table cellSpacing = " 0 " cellPadding = " 0 " width = " 200 " border = " 0 " >
< tr >
< td class = " biance " style = " WIDTH: 87px " ></ td >
< td valign = " top " >
< asp:repeater id = " Repeater1 " runat = " server " >
< ItemTemplate >
< table width = " 200 " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td background = " images/bg.jpg " class = " biance " >< script language = " javascript " >
document.write( " <img src="images/<%# DataBinder.Eval(Container, " DataItem.ID " ) %>.jpg"> " );
</ script >
< asp:HyperLink id = HyperLink1 Text = ' <%# DataBinder.Eval(Container.DataItem, "biance") %> ' NavigateUrl = ' <%# "detailspage.aspx?id=" + HttpUtility.UrlEncode(DataBinder.Eval(Container.DataItem,"ID").ToString()) %> ' ToolTip = ' <%# DataBinder.Eval(Container.DataItem,"title") %> ' runat = " server " /> </ td >
</ tr >
</ table >
</ ItemTemplate >
</ asp:repeater ></ td >
</ tr >
</ table >
</ td >
< td width = " 79% " >& nbsp; </ td >
</ tr >
</ table >
< tr >
< td class = " biance " style = " WIDTH: 87px " ></ td >
< td valign = " top " >
< asp:repeater id = " Repeater1 " runat = " server " >
< ItemTemplate >
< table width = " 200 " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td background = " images/bg.jpg " class = " biance " >< script language = " javascript " >
document.write( " <img src="images/<%# DataBinder.Eval(Container, " DataItem.ID " ) %>.jpg"> " );
</ script >
< asp:HyperLink id = HyperLink1 Text = ' <%# DataBinder.Eval(Container.DataItem, "biance") %> ' NavigateUrl = ' <%# "detailspage.aspx?id=" + HttpUtility.UrlEncode(DataBinder.Eval(Container.DataItem,"ID").ToString()) %> ' ToolTip = ' <%# DataBinder.Eval(Container.DataItem,"title") %> ' runat = " server " /> </ td >
</ tr >
</ table >
</ ItemTemplate >
</ asp:repeater ></ td >
</ tr >
</ table >
</ td >
< td width = " 79% " >& nbsp; </ td >
</ tr >
</ table >
private void Page_Load( object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
BindData();
}
private void BindData()
{
TAJTJ.Components.SaftTrain st=new SaftTrain();
Repeater1.DataSource = st.GetBookNo();
Repeater1.DataBind();
}
saftTrain代码如下
...
{
// 在此处放置用户代码以初始化页面
BindData();
}
private void BindData()
{
TAJTJ.Components.SaftTrain st=new SaftTrain();
Repeater1.DataSource = st.GetBookNo();
Repeater1.DataBind();
}
saftTrain代码如下
...
这篇关于动态显示图片,并为hyperlink 做鼠标悬停效果的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!