FlowMan页面控件——Ext.NET V1.0

试用过FlowMan的客户大多对它简洁美观的界面抱持肯定态度,其实技术人员在开发界面的时候用了一个小工具,今天开始我们将会用四篇连载和技术爱好者分享它的一些使用方法。

 

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官方下载:www.coolite.com

ExtJS官方下载:www.extjs.com

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

 

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 name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

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

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

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

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

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

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

            <section name="roleService" 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=B77A5C561934E089"/>

            <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 name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

        <add name="DirectRequestModule" 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 name="CompilerVersion" value="v3.5"/>

          <providerOption name="WarnAsError" 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 name="ScriptModule"/>

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

      </modules>

      <handlers>

        <remove name="WebServiceHandlerFactory-Integrated"/>

        <remove name="ScriptHandlerFactory"/>

        <remove name="ScriptHandlerFactoryAppServices"/>

        <remove name="ScriptResource"/>

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

        <add name="ScriptHandlerFactoryAppServices" 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 name="ScriptResource" 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 name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>

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

        </dependentAssembly>

        <dependentAssembly>

          <assemblyIdentity name="System.Web.Extensions.Design" 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 ID="ResourceManager1" runat="server">

 

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