RadControls for ASP.NET AJAX 升级 - 名称“ExpandMode”当前上下文中不存在

发布于 2024-12-02 11:36:43 字数 909 浏览 2 评论 0 原文

明显错误:

当前上下文中不存在名称“ExpandMode”

代码:

  protected void Page_Load(object sender, EventArgs e)
  {
     if (!this.IsPostBack && !this.sectionTree.IsCallBack)
     {
        //populate the first level of tree nodes
        foreach (SiteSection section in SiteSectionCollection.GetRootSections())
        {
           RadTreeNode node = new RadTreeNode(section.Name, section.AssetId.ToString());
           node.ExpandMode = ExpandMode.ServerSideCallBack;
           this.sectionTree.Nodes.Add(node);
        }
     }
  }

背景:

从“RadControls for ASP.NET”升级时到“RadControls for ASP.NET AJAX”时,我遇到了几个问题。 web.config 文件已由升级向导转换。我一开始遇到了 233 个 .NET 编译错误(28 个不同的错误),我很快就解决了这些错误,但由于 API 的剧烈更改,我仍然有 36 个错误(13 个不同的问题)尚未解决。我将把这 13 个错误作为堆栈溢出问题发布,以节省我一些时间。在等待的同时,我将尝试下载他们的控件演示,了解控件如何在最新版本中工作,并亲自回答其他人没有回答的问题。

Distinct error:

The name 'ExpandMode' does not exist in the current context

Code:

  protected void Page_Load(object sender, EventArgs e)
  {
     if (!this.IsPostBack && !this.sectionTree.IsCallBack)
     {
        //populate the first level of tree nodes
        foreach (SiteSection section in SiteSectionCollection.GetRootSections())
        {
           RadTreeNode node = new RadTreeNode(section.Name, section.AssetId.ToString());
           node.ExpandMode = ExpandMode.ServerSideCallBack;
           this.sectionTree.Nodes.Add(node);
        }
     }
  }

Background:

When upgrading from "RadControls for ASP.NET" to "RadControls for ASP.NET AJAX", I ran into several issues. The web.config file was converted by the Upgrade Wizard. I started with 233 .NET compilation errors (28 distinct errors) which I quickly resolved, but I still have 36 errors (13 distinct issues) left from drastic API changes that I still haven't resolved. I will post these 13 errors as questions on stack overflow to save me some time. While I'm waiting I will try downloading their control demos and understand how the controls work for their newest release and answer them myself for those others haven't answered.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜扑 2024-12-09 11:36:43

需要记住的一件事是,ASP.NET AJAX 的 RadControls 与 ASP.NET 的 RadControls 不同。后者(非 AJAX 控件)此时已经相当陈旧,并且缺少新控件(ASP.NET AJAX)将包含的许多功能。这可能会导致某些 API 调用有所不同,如您在上面所见,但请查看 演示文档看看您当前已实现的功能是弄清楚如何在这个新产品中实现它们的一个很好的步骤。

至于这里的问题,您应该能够使用 TreeNodeExpandMode 属性,它是 ASP.NET AJAX 的 RadControls 的一部分,而不是 ExpandMode,它是 RadControls 的一部分ASP.NET。有关各种扩展模式的更多信息,您可以查看 此演示

One thing to keep in mind is that the RadControls for ASP.NET AJAX are different from the RadControls for ASP.NET. The later (non-AJAX controls) are quite old at this time, and lack a lot of the functionality that the new controls (ASP.NET AJAX) will contain. This can cause some API calls to be different, as you have seen above, but taking a look over the demos or documentation to look at the functionality you currently have implemented is a good step for figuring out how to implement them in this new product.

As for the issue at hand here, you should just be able to use the TreeNodeExpandMode property which is part of the RadControls for ASP.NET AJAX, as opposed to the ExpandMode which is a part of the RadControls for ASP.NET. For more information about the various expand modes you can look into this demo.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文