当前位置: 代码迷 >> Web前端 >> 【转载】Ext.Net系列:装配与使用
  详细解决方案

【转载】Ext.Net系列:装配与使用

热度:118   发布时间:2012-08-31 12:55:03.0
【转载】Ext.Net系列:安装与使用
Ext.NET,这个名字可能有些许陌生,但说起ExtJS和Coolite大家应该是相当熟悉的。其实Ext.NET原名Coolite,是Coolite发展到1.0版本后对该产品的重新命名。Ext.NET是基于.NET Framework 3.5的一套支持ASP.NET AJAX的Web控件,它基于跨浏览器的ExtJS 库开发而来并简化了开发步骤,包含有丰富的Ajax运用。



Ext.NET是开源的。由于Ext.NET基于ExtJS的缘故,所以不可避免会有类似ExtJS控件运行又大又慢的毛病,但因为它界面美观,减少了很多美工的精力,你就可以省掉一大串的js代码,界面完全可以用Ext.NET简单配置就得到很炫的页面效果,使程序员可以专注于后台代码的编写。而且Ext.Net的Ajax+Json操作简单方便,因此作为企业应用是相当不错的选择。

Ext.NET是一组开源的Asp.net(WebForm,MVC)组件。基于Ext.Js库开发,含有100多个工具,如TextBox,Combox,Button,ToolBar,StateBar,Panel,TabPanel,ExplorerBar,MenuBar,PictureBox 等多种控件并支持Ajax无刷新效果。

  下载地址:http://www.ext.net/download/

  示例地址:http://examples.ext.net/

  环境:VS2005+、服务器.NET Framework3.5+、网站系统.net 2.0+

Ext.NET最大不足:还是开发阶段,存在不少BUG。

Ext.Net特点:

  1.多种控件。能快速的创建高视觉的用户界面

  2.300多个示例,能让你快速上手

  3.丰富的Ext.js API提供支持

  4开源闭源双协议

Ext.NET配置方法:



1.从官方网站下载Ext.NET:(现版本为Coolite 0.8.2,Ext.NET1.0为Beta版尚未开放下载)

http://www.coolite.com/download/



2.项目中引用

在项目点击引用,通过浏览增加Ext.NET.dll、Ext.NET.Utilities.dll引用。



3.工具箱增加

在工具箱增加Tab Ext.NET。增加文件:Ext.NET.dll。



4.修改Web.config文件,如下设置

<?xml version="1.0"?><configuration>

    <configSections>

      <sectionGroup type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

        <sectionGroup type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

          <section type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>

          <sectionGroup type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

            <section type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>

            <section type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>

            <section type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>

            <section type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>

          </sectionGroup>

        </sectionGroup>

      </sectionGroup>

    </configSections> 

 

 

    <appSettings/>

    <connectionStrings/>

 

    <system.web>

        <!--

            Set compilation debug="true" to insert debugging

            symbols into the compiled page. Because this

            affects performance, set this value to true only

            during development.

        -->

        <compilation debug="false">

 

          <assemblies>

            <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B< XMLNAMESPACE PREFIX ="ST1" />77A5C561934E089"/>

            <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

            <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

            <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

         

                   <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>

 

        </compilation>

        <!--

            The <authentication> section enables configuration

            of the security authentication mode used by

            ASP.NET to identify an incoming user.

        -->

        <authentication mode="Windows"/>

        <!--

            The <customErrors> section enables configuration

            of what to do if/when an unhandled error occurs

            during the execution of a request. Specifically,

            it enables developers to configure html error pages

            to be displayed in place of a error stack trace.

 

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

            <error statusCode="403" redirect="NoAccess.htm" />

            <error statusCode="404" redirect="FileNotFound.htm" />

        </customErrors>

        -->

 

      <pages>

        <controls>

          <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

          <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

        </controls>

      </pages>

 

      <httpHandlers>

        <remove verb="*" path="*.asmx"/>

        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

        <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

        <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>

      </httpHandlers>

      <httpModules>

        <add type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

        <add type="Ext.Net.DirectRequestModule, Ext.Net" />

      </httpModules>

    </system.web>

 

    <system.codedom>

      <compilers>

        <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

          <providerOption value="v3.5"/>

          <providerOption value="false"/>

        </compiler>

     </compilers>

    </system.codedom>

   

    <!--

        The system.webServer section is required for running ASP.NET AJAX under Internet

        Information Services 7.0.  It is not necessary for previous version of IIS.

    -->

    <system.webServer>

      <validation validateIntegratedModeConfiguration="false"/>

      <modules>

        <remove />

        <add preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

      </modules>

      <handlers>

        <remove />

        <remove />

        <remove />

        <remove />

        <add verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

        <add verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

        <add preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

      </handlers>

    </system.webServer>

 

    <runtime>

      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

        <dependentAssembly>

          <assemblyIdentity publicKeyToken="31bf3856ad364e35"/>

          <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>

        </dependentAssembly>

        <dependentAssembly>

          <assemblyIdentity publicKeyToken="31bf3856ad364e35"/>

          <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>

        </dependentAssembly>

      </assemblyBinding>

    </runtime>

 

</configuration>




5.在页面中添加Ext.NET引用

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>




6.在使用Ext.NET控件时必须注意,添加任意控件之前必须添加ResourceManager控件

<ext:ResourceManager runat="server">




完成配置之后,就让我们准备开始奇妙的Ext.NET之旅吧!
  相关解决方案