星空网 > 软件开发 > ASP.net

Ext.Net 学习随笔 001 安装Ext.Net

Ext.Net版本:4.1.0

Ext.Net官网:ext.net

Ext.Net官方演示:mvc.ext.net

Ext.Net MVC Example 下载:github.com/extnet/.NET.aspx' >Ext.NET.Examples.MVC

Ext.Net Nuget 地址:www.nuget.org/packages/Ext.NET.MVC

1. Ext.Net安装

建立MVC项目(DotNet 4.0 以上),安装程序包

Install-Package Ext.NET.MVC

 手动安装方法:

  (1)下载安装包

  (2)项目引用Ext.Net的相关程序集

Ext.Net.dllExt.Net.Utilties.dllNewtonsoft.Json.dllTransformer.NET.dll

  (3)修改web.config如下

Ext.Net 学习随笔 001 安装Ext.NetExt.Net 学习随笔 001 安装Ext.Net
<?"1.0" encoding="utf-8"?><!-- 有关如何配置 ASP.NET 应用程序的详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=301880 --><configuration> <configSections>  <section name="extnet" type="Ext.Net.GlobalConfig" requirePermission="false" /> </configSections> <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.2" />  <httpRuntime targetFramework="4.5.2" />  <httpModules>   <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />  </httpModules> <!-- This httpHandlers config only required if using IIS6 (or lower) --><!--  <httpHandlers>   <add path="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler" validate="false" />  </httpHandlers>  --><!-- This httpModules config only required if using IIS6 (or lower) --><!--  <httpModules>   <add name="DirectRequestModule" type="Ext.Net.DirectRequestModule, Ext.Net" />  </httpModules>  --><pages>   <controls>    <add assembly="Ext.Net" namespace="Ext.Net" tagPrefix="ext" />   </controls>   <namespaces>    <add namespace="Ext.Net" />    <add namespace="Ext.Net.MVC" />   </namespaces>  </pages></system.web> <system.webServer>  <handlers>   <remove name="ExtensionlessUrlHandler-Integrated-4.0" />   <remove name="OPTIONSVerbHandler" />   <remove name="TRACEVerbHandler" />   <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />  <add name="DirectRequestHandler" verb="*" path="*/ext.axd" preCondition="integratedMode" type="Ext.Net.ResourceHandler" /></handlers>  <validation validateIntegratedModeConfiguration="false" />  <modules>   <remove name="ApplicationInsightsWebTracking" />   <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />  <add name="DirectRequestModule" preCondition="managedHandler" type="Ext.Net.DirectRequestModule, Ext.Net" /></modules> </system.webServer> <runtime>  <assemblyBinding "urn:schemas-microsoft-com:asm.v1">   <dependentAssembly>    <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />    <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.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.Mvc" publicKeyToken="31bf3856ad364e35" />    <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.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>  </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><extnet theme="Triton" licenseKey="** Ext.NET LICENSE KEY HERE **" initScriptMode="Linked" /></configuration>

MVC4 web.config

测试项目,建立测试页面,代码如下

Ext.Net 学习随笔 001 安装Ext.NetExt.Net 学习随笔 001 安装Ext.Net
@using Ext.Net;@using Ext.Net.MVC;@{  Layout = null;  var X = Html.X();}<!DOCTYPE html><html><head>  <meta name="viewport" content="width=device-width" />  <title>Ext.Net 示例</title></head><body>@(Html.X().ResourceManager())@(X.Panel()   .ID("Window1")   .Title("Welcome to Ext.NET")   .Height(215)   .Weight(350)   .Frame(true)   .Collapsible(true)   .Cls("box")   .BodyPadding(5)   .DefaultButton("0")   .Layout("AnchorLayout")   .DefaultAnchor("100%")   .Items(     Html.X().FormPanel()      .Layout(LayoutType.Anchor)      .DefaultAnchor("100%")      .Border(false)      .BodyPadding(5)      .Items(Html.X().TextArea()        .ID("message")        .EmptyText(">> Enter a Message Here <<")        .FieldLabel("Text Message")        .Height(85)      )      .Buttons(        Html.X().Button()          .Text("Submit")          .Icon(Icon.Accept)          .DirectClickAction("Notify")      )   ))</body></html>

视图代码
Ext.Net 学习随笔 001 安装Ext.NetExt.Net 学习随笔 001 安装Ext.Net
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;using Ext.Net;using Ext.Net.MVC;namespace MVC4_01.Controllers{  public class TestController : Controller  {    // GET: Test    public ActionResult Index()    {      return View();    }    public ActionResult Notify(string message)    {      X.Msg.Notify(new NotificationConfig {         Icon = Icon.Accept,        Title = "Working",        Html = message      }).Show();      return this.Direct();    }  }}

控制器代码

 




原标题:Ext.Net 学习随笔 001 安装Ext.Net

关键词:.NET

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

你的外贸网站连这些要素都没有,转化率怎么会好?:https://www.ikjzd.com/articles/102465
4款免费又好用的外贸站测速工具分享:https://www.ikjzd.com/articles/102466
外贸网站SSL证书是什么?关于SSL证书详解!:https://www.ikjzd.com/articles/102468
Listing不地道?亚马逊升级版ASIN Localization带你飞!:https://www.ikjzd.com/articles/102475
2019 prime day 旺季过后收到A-to-Z索赔请别慌!解救订单方法在这!:https://www.ikjzd.com/articles/102476
如何利用Facebook免费工具,选择目标市场?:https://www.ikjzd.com/articles/102478
下周开始,安徽人免费游九华山,带上身份证就:https://www.vstour.cn/a/408234.html
上海滑雪场门票价格?:https://www.vstour.cn/a/408235.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流