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£¬²¢½øÒ»²½Õ¹Ê¾Ç°Îĺ ......
1. JSÖÐÈ¡µÃAsp.NetµÄÖµ
(1)È¡µÃ·þÎñ¶Ë¿Ø¼þµÄÖµ
var s = document.getElementById("TextBox1").value; //È¡µÃTextBox1µÄTextÖµ
(2)È¡µÃÈ«¾Ö±äÁ¿µÄÖµ
ÔÚPage_Load()·½·¨Ç°¶¨Òåprotected String sT;
ÔÚPage_Load()·½·¨Öи³ÖµsT = "¹þ¹þ";
JSÖÐÕâÑùдȡµÃ
var s = "<%=sT %>";
-------------------- ......
public static string TheColor(string color,string enumName)
{
return string.Format("<span style=\"color={0}\">{1}</span>",color,enumName);
  ......
×î½üÔÚѧУÀïÃæ£¬ÀÏʦÈÃÎÒÃÇ×öÒ»¸öÀàËÆÓÚÉçÇøÐ͵IJ©¿ÍÍøÕ¾£¬¾ÍÏñ°Ù¶È¿Õ¼äÄÇÖֵģ¬¸Ð¾õ²»ÊǺܸ´ÔÓ£¬¹Ø¼üÊÇÑùʽҪ×öµÃºÃ¿´£¬»»·ôµÄ¹¦ÄÜÈÃÎҺܾÀ½á£¬ÎâSir¸øÎÒÃǵĽ¨ÒéÊǰÑÄÇЩ¹¦Äܶ¼×ö³ÉÓû§¿Ø¼þ£¬È»ºóÒªÓõÄʱºò£¬Ö±½ÓÍϽøÀ´¾ÍÐÐÁË£¬¿ÉÒÔ×öÁ½Ì×ÍêÈ«ÍêÈ«²»Í¬·ç¸ñµÄÍøÒ³£¬ÔÚÎÒÃÇĿǰDIV+CSSˮƽÏ൱²ËµÄÇé¿öÏ£¬Õâ ......
.NET¡¢ASP.NET¿Ø¼þ¼°Ô´Âë´ó»ã×Ü
×÷ÕߣºAllan_Green À´Ô´£º²©¿ÍÔ° ·¢²¼Ê±¼ä£º2009-02-12 10:33 ÔĶÁ£º224 ´Î ÔÎÄÁ´½Ó [ÊÕ²Ø]
.NET¡¢ASP.NET¿Ø¼þ¼°Ô´Âë´ó»ã×Ü
CuteEditor 6.0 ÔÚÏßHTML±à¼Æ÷µÄÁ캽Õß
ComponentArt.Charting.WebChart.dll
Comp ......