DevExpress Asp.Net - 1 已有MVC项目使用DX

1.引用DX程序集

项目引用如下程序集

  • DevExpress.Charts.v16.2.Core
  • DevExpress.Dashboard.v16.2.Core
  • DevExpress.Dashboard.v16.2.Web
  • DevExpress.Dashboard.v16.2.Web.Mvc
  • DevExpress.Data.v16.2
  • DevExpress.DataAccess.v16.2
  • DevExpress.Office.v16.2.Core.dll
  • DevExpress.PivotGrid.v16.2.Core
  • DevExpress.Printing.v16.2.Core
  • DevExpress.RichEdit.v16.2.Core.dll
  • DevExpress.SpellChecker.v16.2.Core
  • DevExpress.Spreadsheet.v16.2.Core
  • DevExpress.Utils.v16.2
  • DevExpress.Web.ASPxGauges.v16.2
  • DevExpress.Web.ASPxHtmlEditor.v16.2
  • DevExpress.Web.ASPxPivotGrid.v16.2
  • DevExpress.Web.ASPxRichEdit.v16.2
  • DevExpress.Web.ASPxScheduler.v16.2
  • DevExpress.Web.ASPxSpellChecker.v16.2
  • DevExpress.Web.ASPxSpreadsheet.v16.2
  • DevExpress.Web.ASPxThemes.v16.2
  • DevExpress.Web.ASPxTreeList.v16.2
  • DevExpress.Web.Mvc.v16.2 (or DevExpress.Web.Mvc5.v16.2 if using ASP.NET MVC 5)
  • DevExpress.Web.v16.2
  • DevExpress.Xpo.v16.2
  • DevExpress.XtraCharts.v16.2
  • DevExpress.XtraCharts.v16.2.Web
  • DevExpress.XtraGauges.v16.2.Core
  • DevExpress.XtraGauges.v16.2.Presets
  • DevExpress.XtraPivotGrid.v16.2
  • DevExpress.XtraReports.v16.2
  • DevExpress.XtraReports.v16.2.Web
  • DevExpress.XtraScheduler.v16.2.Core

2.在Web.config中注册Http Handler

注册ASPxHttpHandlerModule:

Web.config > configuration > system.web > httpModules 和 configuration > system.webService > modules 中,注册ASPxHttpHandlerModule。

注册文件上次使用的ASPxUploadProgressHttpHandler

在Web.config > configuration > system.web > httpHandlers 和 configuration > system.webServer > handlers中,注册ASPxUploadProgressHttpHandler。

<?xml version="1.0" encoding="utf-8"?>
<!--
  有关如何配置 ASP.NET 应用程序的详细信息,请访问
  http://go.microsoft.com/fwlink/?LinkId=301880
  -->
<configuration>
  <appSettings>
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <httpModules>
      <add type="DevExpress.Web.ASPxHttpHandlerModule, DevExpress.Web.v16.2, Version=16.2.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" name="ASPxHttpHandlerModule"/>
    </httpModules>
    <httpHandlers>
      <add type="DevExpress.Web.ASPxUploadProgressHttpHandler, DevExpress.Web.v16.2, Version=16.2.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" verb="GET,POST" path="ASPxUploadProgressHandlerPage.ashx" validate="false" />
    </httpHandlers>
  </system.web>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>
  <system.webServer>
    <modules>
      <add type="DevExpress.Web.ASPxHttpHandlerModule, DevExpress.Web.v16.2, Version=16.2.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" name="ASPxHttpHandlerModule"/>
    </modules>
    <handlers>
      <add type="DevExpress.Web.ASPxUploadProgressHttpHandler, DevExpress.Web.v16.2, Version=16.2.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" verb="GET,POST" path="ASPxUploadProgressHandlerPage.ashx" name="ASPxUploadProgressHandler" preCondition="integratedMode" />
    </handlers>
  </system.webServer>
</configuration>

3.在~/Views/Web.config中注册DX的命名空间

注册视图使用的DevExpress命名空间

<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
<add namespace="System.Web.UI.WebControls" />
<add namespace="DevExpress.Utils" />
<add namespace="DevExpress.Web.ASPxTreeList" />
<add namespace="DevExpress.Web.ASPxHtmlEditor" />
<add namespace="DevExpress.Web.ASPxSpellChecker" />
<add namespace="DevExpress.Web.ASPxThemes" />
<add namespace="DevExpress.XtraCharts" />
<add namespace="DevExpress.XtraCharts.Web" />
<add namespace="DevExpress.XtraReports" />
<add namespace="DevExpress.XtraReports.UI" />
<add namespace="DevExpress.XtraReports.Web" />
<add namespace="DevExpress.XtraReports.Web.DocumentViewer" />
<add namespace="DevExpress.XtraPivotGrid" />
<add namespace="DevExpress.Data.PivotGrid" />
<add namespace="DevExpress.Web.ASPxPivotGrid" />
<add namespace="DevExpress.Web.Mvc" />
<add namespace="DevExpress.Web.Mvc.UI" />
<add namespace="DevExpress.XtraScheduler" />
<add namespace="DevExpress.XtraScheduler.Native" />
<add namespace="DevExpress.Web.ASPxScheduler" />
<add namespace="DevExpress.DashboardWeb.Mvc" />
<add namespace="DevExpress.Web.ASPxSpreadsheet" />
<add namespace="DevExpress.Web.ASPxRichEdit" />

4.在Web.config中注册DevExpress的配置项

<configSections>
	<sectionGroup name="devExpress">
	  <section name="themes" type="DevExpress.Web.ThemesConfigurationSection, DevExpress.Web.v16.2, Version=16.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" />
	  <section name="compression" type="DevExpress.Web.CompressionConfigurationSection, DevExpress.Web.v16.2, Version=16.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" />
	  <section name="settings" type="DevExpress.Web.SettingsConfigurationSection, DevExpress.Web.v16.2, Version=16.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" />
	  <section name="errors" type="DevExpress.Web.ErrorsConfigurationSection, DevExpress.Web.v16.2, Version=16.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" />
	  <section name="resources" type="DevExpress.Web.ResourcesConfigurationSection, DevExpress.Web.v16.2, Version=16.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" />
	</sectionGroup>
</configSections>

 

<devExpress>
	<themes enableThemesAssembly="true" styleSheetTheme="" theme="Metropolis" customThemeAssemblies="" baseColor="Green" font="30px 'Callibri'"  />
	<compression enableHtmlCompression="false" enableCallbackCompression="true" enableResourceCompression="true" enableResourceMerging="true" />
	<settings doctypeMode="Html5" rightToLeft="false" ieCompatibilityVersion="edge" />
	<errors callbackErrorRedirectUrl="" />
	<resources>
	  <add type="ThirdParty" />
	  <add type="DevExtreme" />
	</resources>
</devExpress>

 

5.附加必须的JavaScript脚本

<script src="@Url.Content("~/Scripts/jquery-1.11.3.min.js")" type="text/javascript"></script>

@Html.DevExpress().GetScripts( 
    new Script { ExtensionSuite = ExtensionSuite.NavigationAndLayout }, 
    new Script { ExtensionSuite = ExtensionSuite.HtmlEditor }, 
    new Script { ExtensionSuite = ExtensionSuite.GridView }, 
    new Script { ExtensionSuite = ExtensionSuite.PivotGrid },
    new Script { ExtensionSuite = ExtensionSuite.Editors }, 
    new Script { ExtensionSuite = ExtensionSuite.Chart },
    new Script { ExtensionSuite = ExtensionSuite.Report },
    new Script { ExtensionSuite = ExtensionSuite.Scheduler },
    new Script { ExtensionSuite = ExtensionSuite.TreeList },
    new Script { ExtensionSuite = ExtensionSuite.Spreadsheet },
    new Script { ExtensionSuite = ExtensionSuite.RichEdit },
    new Script { ExtensionSuite = ExtensionSuite.SpellChecker }
)

6.附加必须的Css样式

 

7.设置路由

 

8.重写默认模型绑定

 

9.移除默认项目的CSS样式

 

10.检查视图文档类型

 

11.添加扩展代码

 

 

 

 

 

 

 

 

转载于:https://my.oschina.net/fdstudio/blog/879951

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: DevExpress是一家提供各种软件开发工具的公司,而他们的ASP.NET Web Forms是为开发人员提供构建Web应用程序的完整框架。 DevExpress ASP.NET Web Forms视频是由DevExpress公司制作的教育视频系列。这些视频旨在为开发人员提供使用DevExpress ASP.NET Web Forms的详细说明。通过这些视频,您将学习如何使用DevExpress ASP.NET Web Forms的各种控件和组件来构建高质量的Web应用程序。 视频系列涵盖了很多关键概念,包括如何创建响应式Web页面、如何使用GridView和TreeList控件、如何使用Web服务器控件、如何构建并使用自定义控件等。 这些视频配有详细讲解和示例演示,能够帮助开发人员更好地理解和掌握DevExpress ASP.NET Web Forms框架。它们是学习DevExpress ASP.NET Web Forms的重要资源,无论您是初学者还是有经验的开发人员,都会发现它们非常有用。 ### 回答2: DevExpress是一款非常流行的ASP.NET Web Forms控件库。通过使用DevExpress的控件库,开发人员可以轻松地为其ASP.NET Web应用程序添加各种功能和界面元素。 该控件库中包含了大量的可定制和易于使用的控件,如文本框、按钮、列表、下拉框等,使开发人员能够快速构建现代、美观的Web应用程序。DevExpress控件库还提供了许多高级功能,如表格、图表和图形,这些功能可以帮助开发人员更好地展示数据。 值得一提的是,DevExpress还提供了非常丰富的文档和示例,这使开发人员能够快速掌握其API。此外,DevExpress的技术支持也非常出色,可以帮助您解决任何使用上的难题。 总之,DevExpress ASP.NET Web Forms视频可以让开发人员更好地了解和使用DevExpress控件库,从而更好地构建ASP.NET Web应用程序。 ### 回答3: Devexpress asp.net web forms 视频是一种帮助开发人员学习和使用Devexpress asp.net web forms技术的在线资源。Devexpress asp.net web forms是一款功能强大且广泛应用于企业级应用程序开发的框架,它结合了强大的数据绑定、MVC模型、控件库和用户界面等特性。 该视频提供了从基础到高级的Devexpress asp.net web forms开发相关的教程和示例,适用于各种开发经验和技能水平的开发人员。通过观看这些视频,开发人员可以学习如何使用不同类型的控件、组件和功能来构建丰富、灵活的Web应用程序。 此外,Devexpress asp.net web forms视频还提供了现场演示、实时分析以及解决问题方案的方法,帮助开发人员解决在Web应用程序开发中所遇到的实际问题。这些视频也可以帮助新手开发人员了解Devexpress asp.net web forms框架的特性和优势,使他们能够迅速上手并为自己的项目做出卓越的贡献。 总之,Devexpress asp.net web forms视频是一个非常有用的工具,可以帮助开发人员掌握Devexpress asp.net web forms技术并发展其开发技能。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值