http://www.shuangyongjulebu.com/yikatong/default.aspxusing DataAccess;public partial class _yikatong_Default1 : System.Web.UI.Page
{
const int length = 14;
const int piclength = 8;
public string strVideo = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ActiveVideo av = new ActiveVideo();
int av_Id = Convert.ToInt32(1);
av = av.GetModel(av_Id);
strVideo = av.av_Video;
//Bulletin bl = new Bulletin(); //绑定公告开始
//dlBuletin.DataSource = bl.GetNewsByType(11);
//dlBuletin.DataBind(); //绑定公告结束
BindPage();
//BindRptType(); }
}
public void BindPage()
{ BindDl(dl就业培训, 22);
BindDl(dl军训拓展, 12);
BindDl(dl俱乐部新闻, 13);
BindPicture(dl宾馆酒店, 1);
BindPicture(dl生活服务, 10);
BindPicture(dl休闲娱乐, 5);
}
public void BindPicture(DataList dl, int type)
{ dl.DataSource = Navigation_Cache.BindSubCategoryAndNum(type, piclength);
dl.DataBind();
}
public void BindDl(DataList dl, int type)
{
dl.DataSource = Bulletin_Cache.BindByTypeAndNum(type, length);
dl.DataBind(); } protected string toscha(string s)
{
if (s.Length > 17)
return s.Remove(16) + "....";
else
return s;
}
public string SelectDetails(string v_Na_Id)
{
Bulletin b = new Bulletin();
int bl_Id = b.fn根据企业导航表的外键id来获得bl_Id(int.Parse(v_Na_Id));
return this.ResolveClientUrl("~/yikatong/Bulletin.aspx?bl_Id=" + bl_Id + "");
} public string CompanyUrl(string url, string v_Na_Id)
{
string result = "";
if (url.Length > 0)
{
result = url;
} else
{
result = SelectDetails(v_Na_Id);
}
return result;
} protected void btnSearch_Click(object sender, EventArgs e)
{
if (ddl搜索类型.SelectedItem.Text == "站内搜索")
{
Response.Redirect(this.ResolveClientUrl("~/yikatong/SearchResult.aspx?sou=") + txtSearch.Text.Trim());
}
else
{
Response.Redirect(this.ResolveClientUrl("~/seach/ShowGoogle.aspx?info=") + txtSearch.Text.Trim());
}
}
}
{
const int length = 14;
const int piclength = 8;
public string strVideo = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ActiveVideo av = new ActiveVideo();
int av_Id = Convert.ToInt32(1);
av = av.GetModel(av_Id);
strVideo = av.av_Video;
//Bulletin bl = new Bulletin(); //绑定公告开始
//dlBuletin.DataSource = bl.GetNewsByType(11);
//dlBuletin.DataBind(); //绑定公告结束
BindPage();
//BindRptType(); }
}
public void BindPage()
{ BindDl(dl就业培训, 22);
BindDl(dl军训拓展, 12);
BindDl(dl俱乐部新闻, 13);
BindPicture(dl宾馆酒店, 1);
BindPicture(dl生活服务, 10);
BindPicture(dl休闲娱乐, 5);
}
public void BindPicture(DataList dl, int type)
{ dl.DataSource = Navigation_Cache.BindSubCategoryAndNum(type, piclength);
dl.DataBind();
}
public void BindDl(DataList dl, int type)
{
dl.DataSource = Bulletin_Cache.BindByTypeAndNum(type, length);
dl.DataBind(); } protected string toscha(string s)
{
if (s.Length > 17)
return s.Remove(16) + "....";
else
return s;
}
public string SelectDetails(string v_Na_Id)
{
Bulletin b = new Bulletin();
int bl_Id = b.fn根据企业导航表的外键id来获得bl_Id(int.Parse(v_Na_Id));
return this.ResolveClientUrl("~/yikatong/Bulletin.aspx?bl_Id=" + bl_Id + "");
} public string CompanyUrl(string url, string v_Na_Id)
{
string result = "";
if (url.Length > 0)
{
result = url;
} else
{
result = SelectDetails(v_Na_Id);
}
return result;
} protected void btnSearch_Click(object sender, EventArgs e)
{
if (ddl搜索类型.SelectedItem.Text == "站内搜索")
{
Response.Redirect(this.ResolveClientUrl("~/yikatong/SearchResult.aspx?sou=") + txtSearch.Text.Trim());
}
else
{
Response.Redirect(this.ResolveClientUrl("~/seach/ShowGoogle.aspx?info=") + txtSearch.Text.Trim());
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货