private void CreateMenu()
{
string type1="SELECT distinct forebear from t_Type where Type_Level = 2 order by forebear";
SqlDataReader sdr;
dc.refConn(ref dbconn);
dbconn.Open();
SqlCommand sc=new SqlCommand(type1,dbconn);
sdr=sc.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
while(sdr.Read())
{
string type2="select type_name,url,Type_id from t_Type where Type_Level = 2 and forebear='"+sdr.GetInt32(0)+"'";
SqlDataReader sdr2;
SqlConnection myconn=new SqlConnection();
dc.refConn(ref myconn);
myconn.Open();
SqlCommand sc2=new SqlCommand(type2,myconn);
sdr2=sc2.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
tempstr=@"<div style='display:none;position:absolute; left:"+j+"px; top:73px; width:100px; height:131px; z-index:1' id=menu"+i+" onMouseOver=swp('menu"+i+"','1') onMouseOut=swp('menu"+i+"','0')><table bgcolor='#C7C7C7'>";
while(sdr2.Read())
{
tempstr += @"<tr><td>";
if(sdr2.GetString(1)=="0")
{
tempstr += @"<a class='text-008' href='"+getUrl(sdr.GetInt32(0))+"/info.aspx?id="+sdr2.GetInt32(2)+"'>"+sdr2.GetString(0)+"</a>";
}
else
{
tempstr += @"<a class='text-008' href="+sdr2.GetString(1)+" >"+sdr2.GetString(0)+"</a>";
}
tempstr +=@"</td></tr>";
}
tempstr += @"</table></div>";
j+=95;
i+=1;
Response.Write(tempstr);
sdr2.Close();
}
sdr.Close();
}
生成的菜单见www.flasherclub.com/shengse/index.aspx
多谢各位老大!
6 个解决方案
#1
顶
#2
up
#3
刚才试了一下创建3层 IE 挂鸟 不知道哪里出了问题 …… UP 了
#4
up
#5
aspnetmenu 很容易用
#6
up
#1
顶
#2
up
#3
刚才试了一下创建3层 IE 挂鸟 不知道哪里出了问题 …… UP 了
#4
up
#5
aspnetmenu 很容易用
#6
up