Cascading DropDownLists With ASP.NET and jQuery
Cascading drop down lists is a really nice feature for web developers. I thought it was time to write an article on how to do this using ASP.NET and jQuery. Well here’s one way of doing it. Before we get started, this example uses the latest version of jQuery which is 1.3.2. That can be downloaded from here.
Open Visual Studio 2008 and create a new Web Application. For this article I’m not going to connect to a database. I’ve created two classes, Employee and EmployeeCars, which will store the data. Create two new classes and add the following code:
C#
public class Employee
{
public int Id { get; set; }
public string GivenName { get; set; }
public string Surname { get; set; }
public List<Employee> FetchEmployees()
{
return new List<Employee>
{
new Employee {Id = 1, GivenName = "Tom", Surname = "Hanks"},
new Employee {Id = 2, GivenName = "Tiger", Surname = "Woods"},
&nb
Ïà¹ØÎĵµ£º
»·¾³£º
Windows 2008, VS 2008 SP1, Asp.Net Mvc RC1
------------------------------------------------------------------------------
ÉÏÎÄ£ºAsp.Net Mvc: Model Binding »úÖÆ·ÖÎö ÖУ¬ÎÒÃǼòµ¥·ÖÎöÁËAsp.Net MvcÖÐModel BindingµÄ¹ý³Ì£¬·Ç³£´Ö²Ú£¬±¾ÎĽ«Ì½Ë÷ÈçºÎʵÏÖÒ»¸ö×Ô¼ºµÄModelBinder£¬²¢½øÒ»²½Õ¹Ê¾Ç°Îĺ ......
ʲôÊÇCache¶ÔÏó?
ÄãÔÚÉú³É¸ßÐÔÄÜÍøÂçÓ¦ÓóÌÐòʱËùÓöµ½µÄÒ»¸öÎÊÌâ¾ÍÊÇÐèÒª±ÜÃâÖØ¸´¡£Ò»¸öCache¶ÔÏóÔÊÐíÔÚËüÃǵÚÒ»´Î±»ÇëÇóʱÔÚÄÚ´æÖлº´æÏȻºó½«±»»º´æµÄ¸±±¾ÓÃÓÚÒÔºóµÄÇëÇó¡£Ê¹Óñ»»º´æµÄ¸±±¾ÔÊÐíÄã±ÜÃâÖØ½¨Âú×ãÒÔǰÇëÇóµÄÐÅÏ¢£¬ÌرðÊÇÄÇЩÿ´Î´´½¨Ê±¶¼ÐèÕ¼ÓÐÃ÷ʾµÄ·þÎñÆ÷ÉϵĴ¦ÀíÆ÷ʱ¼äµÄÃüÁî¡£
³ý»º´æ¸ö±ðÏÈç» ......
string[] files = Directory.GetDirectories(Server.MapPath("Themes/"));
ÏÈÉùÃ÷ÁËÒ»¸ö×Ö·ûÊý×飬mapPath·½·¨µÃµ½µÄÊÇÒ»¸ö¾ø¶Ô·¾¶¡£
ÒòΪGetFiles·µ»ØµÄÊÇÒ»¸östring[]Êý×飬ËùÒÔÓà filesÀ´½ÓÊÕËü¡£
È»ºóÎÒÃÇÔÚÓÃÒ»¸öforeachÑ»·À´±éÀúÕâ¸öÊý×飬ȡ³öËùÓÐÖµ¡£
foreach (string file in files)
{
Response.W ......
public static string TheColor(string color,string enumName)
{
return string.Format("<span style=\"color={0}\">{1}</span>",color,enumName);
  ......
½éÉÜ
CKEditorÊÇÐÂÒ»´úµÄFCKeditor£¬ÊÇÒ»¸öÖØÐ¿ª·¢µÄ°æ±¾¡£CKEditorÊÇÈ«Çò×îÓÅÐãµÄÍøÒ³ÔÚÏßÎÄ×Ö±à¼Æ÷Ö®Ò»£¬ÒòÆä¾ªÈ˵ÄÐÔÄÜÓë¿ÉÀ©Õ¹ÐÔ¶ø¹ã·ºµÄ±»ÔËÓÃÓÚ¸÷´óÍøÕ¾¡£¶øCKFinderÊÇÒ»¸ö¹¦ÄÜÇ¿´óµÄajaxÎļþ¹ÜÀíÆ÷¡£Æä¼òµ¥µÄÓû§½çÃæÊ¹µÃ¸÷ÀàÓû§£¬²»¹ÜÊǴӸ߼¶×¨ÒµÈ˲ţ¬»¹ÊÇ»¥ÁªÍø³õѧÕߣ¬¶¼¹»Ö±¹Û¡¢¿ìËÙѧϰµÄѧϰʹÓÃËü¡£
& ......