本人才学asp。net没多久?
往大侠们指点一下,
就是按照高人说的3层构架,
编了一个网站,www.020job.com
我用了200多个存储过程,分页也是指搜索出当前页要的数据。但是在性能上有什么好的建议,除了服务器上的硬件条件。
除了什么(!IsPostBack)
还有呢?望大家讨论一下!我看看网站比如www.hzrc.com在什么时候都很快,是怎么实现的。高手多发发言!
指点一下。
往大侠们指点一下,
就是按照高人说的3层构架,
编了一个网站,www.020job.com
我用了200多个存储过程,分页也是指搜索出当前页要的数据。但是在性能上有什么好的建议,除了服务器上的硬件条件。
除了什么(!IsPostBack)
还有呢?望大家讨论一下!我看看网站比如www.hzrc.com在什么时候都很快,是怎么实现的。高手多发发言!
指点一下。
我怎么改?
MyZhiming.DataSource = Qiying.WebModules.Accounts.Business.User.GetIndexZhimingTop().Tables[0].DefaultView;
MyZhiming.DataBind();
MyNewNews.DataSource = Qiying.WebModules.Accounts.Business.User.GetIndexNewsTop().Tables[0].DefaultView;
MyNewNews.DataBind();MyDataJob.DataSource = Qiying.WebModules.Person.Business.Meng.GetComTop().Tables[0].DefaultView;
MyDataJob.DataBind();MyDataPerson.DataSource = Qiying.WebModules.Enterprise.Business.Meng.GetPersonTop().Tables[0].DefaultView;
MyDataPerson.DataBind();这是我首页邦定的数据,
我应怎么优化?
怎么用缓存优化?我的aspx
中用不用改?
<%@ Page language="c#" Codebehind="index.aspx.cs" AutoEventWireup="false" Inherits="Qiying.Job.Web.Index" %>
LoadData();
}
} void LoadData() { DataView Source = (DataView)Cache["MyData"]; if(Source == null) { // read the data from the XML source
DataSet ds = new DataSet(); FileStream fs = new FileStream(Server.MapPath("authors.xml"), FileMode.Open,FileAccess.Read);
StreamReader reader = new StreamReader(fs);
ds.ReadXml(reader);
fs.Close(); Source = new DataView(ds.Tables[0]); // cache it for future use
Cache.Insert("MyData", Source, new CacheDependency(Server.MapPath("authors.xml"))); // we created the data explicitly, so advertise that fact
CacheMsg.Text = "显式创建的数据集";
}
{
DataView Source = (DataView)Cache["IndexPerson"]; if(Source==null)
{
Source = new DataView(Meng.GetPersonTop().Tables[0]);Cache.Insert("IndexPerson",Source , null,DateTime.Now.AddMinutes(1), TimeSpan.Zero);
}
return Source;}private DataView GetIndexZhiming()
{
DataView Source = (DataView)Cache["IndexZhiming"];
if(Source==null)
{
Source = new DataView(Business.User.GetIndexZhimingTop().Tables[0]);Cache.Insert("IndexZhiming",Source , null,DateTime.Now.AddMinutes(1), TimeSpan.Zero);
}
return Source;
}private DataView GetIndexCom()
{
DataView Source = (DataView)Cache["IndexCom"]; if(Source==null)
{
Source = new DataView(Business.Meng.GetComTop().Tables[0]);Cache.Insert("IndexCom", Source, null,DateTime.Now.AddMinutes(1), TimeSpan.Zero);
}
return Source;
}
private DataView GetIndexNews()
{
DataView Source = (DataView)Cache["IndexNews"]; if(Source==null)
{
Source = new DataView(Business.User.GetIndexNewsTop().Tables[0]);Cache.Insert("IndexNews", Source, null,DateTime.Now.AddMinutes(1), TimeSpan.Zero);
}
return Source;
}我这样在。cs文件中调用是不是就行了
private void BindList()
{
MyZhiming.DataSource = GetIndexZhiming();
MyZhiming.DataBind(); MyNewNews.DataSource = GetIndexNews();
MyNewNews.DataBind(); MyDataJob.DataSource = GetIndexCom();
MyDataJob.DataBind(); MyDataPerson.DataSource = GetIndexPerson();
MyDataPerson.DataBind();
}---------------------------------
大家看看,我这样行不?
<%@ Page EnableViewState="false" %>还就是这个到底有什么用?
他到底禁止了什么??