
public partial class _Default : System.Web.UI.Page
{
BLL.AboutUs ba = new BLL.AboutUs();
BLL.News bn = new BLL.News();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
show();
Session["wew"] = null;
Session["tianlong"] = "true";
}
}
public void show()
{
DAL.About_us da = new DAL.About_us();
da = ba.SelectAboutUs();
labAddress.Text = da.Address;
labTel.Text = da.Tel;
labFax.Text = da.Fax;
labweiboT.Text = da.WeiboT;
labweiboW.Text = da.WeiboW;
AweiboW.HRef = da.WeiboWAddress;
AweiboT.HRef = da.WeiboTAddress;
aMSN.HRef = "http://snind.gotdns.com:8080/message/msn/"; + da.MSN;
aQQ.HRef = "http://wpa.qq.com/msgrd?v=1&;uin=" + da.QQ;
//FlashImg
repFlashImg.DataSource = bn.selectFlashImgListSlong();
repFlashImg.DataBind();
//新闻
repNews.DataSource = bn.SelectAboutUsList5(2);
repNews.DataBind();
//汽车图片
repCarpictures.DataSource = bn.selectCarPictureSList(2, 10);
repCarpictures.DataBind();
}
public string todate(string date)
{
string dd = Convert.ToDateTime(date).ToShortDateString();
return dd;
}
public string substring(string str, int lenth)
{
string restr = str;
if (str.Length > lenth)
{
restr = str.Substring(0, lenth) + "...";
}
return restr;
}
}
检查过web.config文件配置应该没问题。