(25)Use the startMode attribute to reduce the load time for your ASP.NET site 招数25: 使用startMode属性来减少ASP.NET站点加载时间 Every time you update your site, IIS must recompile it during the first request, so the initial request takes significantly longer than
方法是使用LoadControl方法,根据用户控件的相对路径,动态生成用户控件对象 用户控件 public class UserControlA :UserControl { public UserControlA(string name) { //TODO } } 需要动态生成控件的地方 string ucPath = "../UserControls/UserControlA.ascx"; UserControlA ca = Page.LoadControl(ucPath) as
用户控件 // 用户控件源码 namespace wzjr.control { public partial class Topic : System.Web.UI.UserControl { public int FatherTopic { get { return (int)ViewState["Topic"]; } set { ViewState["Topic"] = value; } } public string FatherName { get { re
public ActionResult GetList() { string strSql = "select staff_id,nick_name from tbl_ac_info where status='A'"; SqlDataReader sdr = SqlDbHelper.GetSqlDataReader(strSql); List<SelectListItem> list = new List<SelectListItem>(); while (s