级联下拉列表

时间:2009-03-22 20:53:41

标签: asp.net asp.net-ajax

我在我的页面上使用了很多下拉列表,我正在将我的项目从.net 2003迁移到.net 2008.我想要Ajaxify我的页面并且使用级联下拉列表是否合乎逻辑?Cascading Dropdownlist可以提供任何意外问题吗?顺便说一句,如果我使用Cascading Dropdownlist,我使用pagemethods,而不是webservices?Pagemethods会出现任何问题吗?或者你有建议而不是Cascading Dropdownlist吗?我不想使用3.party组件并感谢你的帮助。

4 个答案:

答案 0 :(得分:2)

ASP.NET AJAX Toolkit没有任何问题。有用。如果你没有在另一个页面上使用相同的下拉菜单,那么使用页面方法会更容易。

答案 1 :(得分:1)

我唯一可以对Cascading下拉列表说的是,如果他们调用的WebMethod出现问题,他们可能会更难调试,因为他们只会返回神秘的错误消息。但是,一旦你意识到这就是正在发生的事情,那么解决它是一个非常快速的步骤。

否则,它们运行良好,并保存管道代码以启用/禁用。

答案 2 :(得分:0)

@using (Html.BeginForm("Index", "Home", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { id = "LoginForm", autocomplete = "off" }))

答案 3 :(得分:-2)

routes:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace PrivateExchange
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapRoute(
                name: "MediaResourcePopup",
                url: "Home/MediaResourcePopup/{wid}/{uiconf_id}/{cache_st}/{entry_id}/{targetId}",
                defaults: new
                {
                    controller = "Home",
                    action = "MediaResourcePopup"
                });

            //routes.MapRoute(
            //name: "BridgeFront",
            //url: "{BridgeFront}/{LaunchBridgeFront}/{user}",
            //defaults: new { controller = "BridgeFront", action = "LaunchBridgeFront", user = "keenan" }
            //);


            routes.MapRoute(
               name: "Message",
               url: "Message/{action}/{id}",
               defaults: new { controller = "Message", action = "Index", id = UrlParameter.Optional }
           );
            routes.MapRoute(
                name: "Plan",
                url: "Plan/{action}/{id}",
                defaults: new { controller = "Plan", action = "Index", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "Enrollment",
                url: "Enrollment/{action}/{id}/{memberCodes}",
                defaults: new { controller = "Enrollment", action = "Index", id = UrlParameter.Optional, memberCodes = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "UserManagement",
                url: "UserManagement/{action}/{id}",
                defaults: new { controller = "UserManagement", action = "Index", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "Employee",
                url: "Employee/{action}/{id}",
                defaults: new { controller = "Employee", action = "Index", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "Dependent",
                url: "Dependent/{action}/{id}",
                defaults: new { controller = "Dependent", action = "List", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "DecisionSupport",
                url: "DecisionSupport/{action}/{id}",
                defaults: new { controller = "DecisionSupport", action = "Index", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "Package",
                url: "Package/{action}/{id}",
                defaults: new { controller = "Package", action = "List", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "Home",
                url: "Home/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional,type=UrlParameter.Optional }
            );

            routes.MapRoute(
               name: "KCaresHome",
               url: "Home/{action}",
               defaults: new { controller = "Home", action = "Login", type = UrlParameter.Optional }
           );

            routes.MapRoute(
                name: "Root",
                url: "{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name : "SSO",
                url : "SSO/SSO/{id}",
                defaults: new { controller = "SSO", action = "SSO" }
                );

            routes.MapRoute(
                name: "Upload",
                url: "Upload/{action}/{id}",
                defaults: new { controller = "Upload", action = "Index", id = UrlParameter.Optional }
            );

 1. List item

enter code here
        }

}