如何封装JS和CSS文件为服务器端控件---ASP.NET 2.0 我们以封装一个JS的日期控件为列子,将它和服务器的TextBox结合在一起做成一个服务器控件,以达到直接托上去就可以使用的效果。其实很简单,大家共同学习。先看看效果图: 方法: 首先:下载一个JS的日期组件,带封装。 然后:建一个日期类文件CalendarBox.cs代码如下: using System; using System.Collections.Generic; using System.ComponentModel
一个简单的动态加载js和css的jquery代码,用于在生成页面时通过js函数加载一些共通的js和css文件。
//how to use the function below:
//$.include('file/ajaxa.js');$.include('file/ajaxa.css');
//or $.includePath = 'file/';$.include(['ajaxa.js','ajaxa.css']);(only if .js and .css files are in th