当我们使用博客,然后使用页面中有用户控件,我们只想在指定的页面HEAD中
载入javascript,我们可先把javascript存成js文件然后添加下面的语句到pageonload
中就可以了。
        HtmlGenericControl Include = new HtmlGenericControl("script");
        Include.Attributes.Add("type", "text/javascript");
        Include.Attributes.Add("src","/JS/HouseSalePriceRangeDropDownList.js");
        this.Page.Header.Controls.Add(Include);
        string onchangeValue = "go(" + "'"+ddlHouseSaleType.ClientID+"'" + ")";
        ddlHouseSaleType.Attributes.Add("onchange", onchangeValue);

posted @ 2006-08-11 12:27 我爱家和生活18e3.com 阅读(432) 评论(2) 编辑