澳门新浦京娱乐场网站-www.146.net-新浦京娱乐场官网
做最好的网站

澳门新浦京娱乐场网站Net安装和选择,安装与利

1.最新版本

 

近来不知什么原因,发现国人有不少开始学习Coolite了,对于有些人可能不知道什么是Coolite,这里先简单介绍一下:

 

2.打开文件,将包含以下文件:

在项目开发过程中一直困扰与页面样式及其用户体验等问题。为了解决这些问题从而提高系统开发效率和增强人机交互能力,所以在网上一直寻找解决方案。

Coolite Toolkit

简介
Coolite Toolkit 是一个支持ASP.NET AJAX的Web控件。
Coolite Toolkit是基于跨浏览器的ExtJS 库开发而来的,并且简化了开发步骤,并且包含有丰富的Ajax运用。
Coolite Toolkit和ExtJS 都是开源的。
官方主页:http://coolite.com
下载地址:
Samples:

澳门新浦京娱乐场网站 1

我在cnblogs 建立了小组,用cnblogs的可以去加入:  

另外最近我加入了讨论Coolite的Q群:86399374

先给那些没有用过ExtJs 或 Coolite 的朋友打一下预防针-- 很多人都知道extjs控件又大又慢,但因为它界面美观,ajax json操作简单方便,因此作为企业应用还是不错的选择。而Coolite基于 extjs,因此无可避免也是继承这个缺点(我现在用的0.7版本的dll有6M多)。但是用了Coolite,你就可以省掉一大串那样管理的js代码了,界面完全可以用它来简单配置就得到很cool的效果,js只是作为少量的客户端操作。

Coolite最大不足是:还是开发阶段,bug不少。

废话少说,给你一个简单的ajax例子,你就明白为什么我喜欢它了:

  1. AjaxEvet:

//这是一个服务端方法

    protected void UpdateTimeStamp(object sender, AjaxEventArgs e)
    {
        this.SetTime();
    }

//Html 调用上述方法
      <ext:Button ID="Button1" runat="server" Text="Click Me">
            <AjaxEvents>
                <Click OnEvent="UpdateTimeStamp">
                    <EventMask ShowMask="true" MinDelay="500" Msg="Updating TimeStamp..."   />
                </Click>
            </AjaxEvents>
        </ext:Button>

OnEvent="UpdateTimeStamp" 就是指点击按钮后调用服务端方法UpdateTimeStamp 来更新某个标签的时间
  1. AjaxMethod:

     <Listeners>
         <Click Handler="Coolite.AjaxMethods.SetTimeStamp();" />
     </Listeners>
    

第一次用coolite的人基本都会漏掉配置这一至关重要的环节。

如果想开启ajax事件,请记得在web.config 里做以下配置:

    <httpHandlers>
      <add path="*/coolite.axd" verb="*" type="Coolite.Ext.Web.ResourceManager" validate="false"/>      
    </httpHandlers>

    <httpModules>     
      <add name="AjaxRequestModule" type="Coolite.Ext.Web.AjaxRequestModule, Coolite.Ext.Web"/>
    </httpModules>

    <modules>
      <!--Coolite Config-->
      <add name="AjaxRequestModule" preCondition="managedHandler" type="Coolite.Ext.Web.AjaxRequestModule, Coolite.Ext.Web"/>
    </modules>

   <handlers>
      <!--Coolite Config-->
      <add name="AjaxRequestHandler" verb="*" path="*/coolite.axd" preCondition="integratedMode" type="Coolite.Ext.Web.ResourceManager"/>
    </handlers>

官方关于配置的详细说明文件:


 

 

最终决定使用Ext.net进行开发。

                         SAMPLE WEB.CONFIG

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="coolite" type="Coolite.Web.UI.GlobalConfig" requirePermission="false" />
  </configSections>
  <!-- 
      COOLITE GLOBAL CONFIGURATION PROPERTIES
      ajaxEventUrl : string
          The url to request for all AjaxEvents.
          Default is "".
      ajaxMethodProxy : ClientProxy
          Specifies whether server-side Methods marked with the [AjaxMethod] attribute will output configuration script to the client.
          If false, the AjaxMethods can still be called, but the Method proxies are not automatically generated.
          Specifies ajax method proxies creation. The Default value is to Create the proxy for each ajax method.
          Default is 'Default'. Options include [Default|Include|Ignore]
      ajaxViewStateMode : ViewStateMode
          Specifies whether the ViewState should be returned and updated on the client during an AjaxEvent.
          The Default value is to Exclude the ViewState from the Response.
          Default is 'Default'. Options include [Default|Exclude|Include]
      cleanResourceUrl : boolean
          The Coolite controls can clean up the autogenerate WebResource Url so they look presentable.       
          Default is 'true'. Options include [true|false]
      clientInitAjaxMethods : boolean
          Specifies whether server-side Methods marked with the [AjaxMethod] attribute will output configuration script to the client.
          If false, the AjaxMethods can still be called, but the Method proxies are not automatically generated.
          Default is 'false'. Options include [true|false]
      gzip : boolean
          Whether to automatically render scripts with gzip compression.       
          Only works when renderScripts="Embedded" and/or renderStyles="Embedded".      
          Default is true. Options include [true|false]
      scriptAdapter : string
          Gets or Sets the current script Adapter.    
          Default is "Ext". Options include [Ext|jQuery|Prototype|YUI]
      renderScripts : ResourceLocationType
          Whether to have the coolite controls output the required JavaScript includes or not.      
          Gives developer option of manually including required <script> files.       
          Default is Embedded. Options include [Embedded|File|None]
      renderStyles : ResourceLocationType
          Whether to have the coolite controls output the required StyleSheet includes or not.      
          Gives developer option of manually including required <link> or <style> files.      
          Default is Embedded. Options include [Embedded|File|None]
      resourcePath : string
          Gets the prefix of the Url path to the base ~/Coolite/ folder containing the resources files for this project.
          The path can be Absolute or Relative.
      scriptMode : ScriptMode
          Whether to include the Release (condensed) or Debug (with inline documentation) Ext JavaScript files.      
          Default is "Release". Options include [Release|Debug]
      sourceFormatting : boolean
          Specifies whether the scripts rendered to the page should be formatted. 'True' = formatting, 'False' = minified/compressed.
          Default is 'false'. Options include [true|false]
      stateProvider : StateProvider
          Gets or Sets the current script Adapter.
          Default is 'PostBack'. Options include [PostBack|Cookie|None]
      theme : Theme
          Which embedded theme to use.      
          Default is "Default". Options include [Default|Gray|Slate]
      quickTips : boolean
          Specifies whether to render the QuickTips. Provides attractive and customizable tooltips for any element.
          Default is 'true'. Options include [true|false]
  -->
  <coolite theme="Default" />
  <!--
      The following system.web section is only requited for running ASP.NET AJAX under Internet
      Information Services 6.0 (or earlier).  This section is not necessary for IIS 7.0 or later.
  -->
  <system.web>
      <httpHandlers>
      <add path="*/coolite.axd" verb="*" type="Coolite.Ext.Web.ResourceManager" validate="false" />
    </httpHandlers>
      <httpModules>
          <add name="AjaxRequestModule" type="Coolite.Ext.Web.AjaxRequestModule, Coolite.Ext.Web" />
      </httpModules>
  </system.web>
    <!--
      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>
            <add name="AjaxRequestModule" preCondition="managedHandler" type="Coolite.Ext.Web.AjaxRequestModule, Coolite.Ext.Web" />
        </modules>
        <handlers>
            <add name="AjaxRequestHandler" verb="*" path="*/coolite.axd" preCondition="integratedMode" type="Coolite.Ext.Web.ResourceManager"/>
        </handlers>
    </system.webServer>
</configuration>

1:增加Ext.net的引用;有三个:Ext.Net.dll  Ext.Net.Utilities.dll  Newtonsoft.Json.dll    (可以直接在工具箱里直接增加Ext.net.dll它就会
自动把那三个引用的)

Ext.Net.dll 

Ext.Net**介绍:**非ExtJS,封装了ExtJS的内容,用于ASP.NET的开发。
  是一组开源的Asp.net(WebForm,MVC)组件。基于Ext.Js库开发,含有100多个工具,如TextBox,Combox,Button,ToolBar,StateBar,Panel,TabPanel,ExplorerBar,MenuBar,PictureBox 等多种控件并支持Ajax无刷新效果。

2: Web.config修改

Ext.Net.Utilities.dll 

下载地址:
示例地址:

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

Ext.Net.xml 

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

3:aspx页的运用要注意两个地方:

Newtonsoft.Json.dll 

Ext.Net**特点:**
1.多种控件。能快速的创建高视觉的用户界面
2.300多个示例,能让你快速上手
3.丰富的Ext.js API提供支持
4开源闭源双协议

  <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>

Newtonsoft.Json.xml 

但现在ext.net2.2版本开始收费,不开源。最后一个开源版本是ext.net2.1。

  <ext:ResourceManager ID="ResourceManager1" runat="server" />

 

下载后要运行Ext.Net需要 下载ASP.NET MVC3,Ext.NET需要这个支持

4:cs页要引入命名空间:using Ext.Net;

3.打开  Visual Studio,创建C#网站项目

下载地址:http://www.microsoft.com/zh-cn/download/details.aspx?id=1491

 

澳门新浦京娱乐场网站 2

打开菜单创建网站

下载其中的:

弹出"创建网站"窗口,选择Asp.net 网站,地位:文件体系, 说话:Visual C# 

澳门新浦京娱乐场网站 3

点击断定

发布的服务器上也需要安装ASP.NET MVC3

4.初次应用时

安装:

在对象箱中右键点击"添加选项卡"

澳门新浦京娱乐场网站 4

选项卡名称Ext

 

在该选项卡中,右键点击“选择项”

澳门新浦京娱乐场网站 5

弹出"选择箱项"对话框,点击“浏览” ,双击选择文件目次下的"Ext.Net.dll"

澳门新浦京娱乐场网站 6


点击“断定”,将在Ext选项卡中呈现多个控件

装完后,Visual Studio中多了如下:

5.设备Web.Config

澳门新浦京娱乐场网站 7

 

Ext.Net安装和使用: 1.下载最新版本 2.打开下载文件,将包含以下文件找到:  2.1 Ext.Net.dll  2.2 Ext.Net.xml

<?xml version="1.0" encoding="utf-8"?>

2.3 Ext.Net.Utilities.dll

<configuration>

2.4 Ext.Net.Utilities.xml  2.5 Newtonsoft.Json.dll  2.6 Newtonsoft.Json.xml 3.打开 Visual Studio,创建C#网站项目  3.1打开VS2010菜单创建网站  3.2弹出"创建网站"窗口,选择Asp.net 网站,位置:文件系统, 语言:Visual C# 点击确定 4.首次使用时 在工具箱中右键点击"添加选项卡" 选项卡名称Ext

 <configSections>

在该选项卡中,右键点击“选择项” 弹出"选择箱项"对话框,点击“浏览” ,双击选择下载文件目录下的"Ext.Net.dll" 点击“确定”,将在Ext选项卡中出现多个控件 5.配置Web.Config

      <section name="extnet" type="Ext.Net.GlobalConfig" requirePermission="false" />

<?xml version="1.0" encoding="utf-8"?>

<configSections>

<configuration>

<extnet /> 

<configSections>

<!--         The following system.web section is only requited for running ASP.NET AJAX under Internet        Information Services 6.0 (or earlier).  This section is not necessary for IIS 7.0 or later.    -->

    <section name="extnet" type="Ext.Net.GlobalConfig" requirePermission="false" />

    <system.web>

  </configSections>

        <httpHandlers>

  <!--<extnet theme="Gray" renderScripts="CDN" renderStyles="CDN" initScriptMode="Linked" />-->

            <add path="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler" validate="false" />

  <extnet scriptMode="Debug" theme="Gray" />

        </httpHandlers>

  <!--<appSettings>

        <httpModules>

    <add key="ShowHiddenExamples" value="False" />

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

    <add key="LocalLogging" value="True" />

       </httpModules>

    <add key="GoogleAnalytics" value="False" />

    </system.web>

  </appSettings>-->

       <!--         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.web>

    <system.webServer>

    <!-- DO NOT change this trust level. Application MUST run in "Medium" trust. -->

        <validation validateIntegratedModeConfiguration="false"/>

    <!-- Full trust is required for the FeedViewer example because of outbound HTTP requests to fetch RSS feeds -->

        <modules>

    <trust level="Full" />

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

    <webServices>

        </modules>

      <protocols>

        <handlers>

        <add name="HttpGet" />

            <add name="DirectRequestHandler"   verb="*"    path="*/ext.axd"   preCondition="integratedMode"    type="Ext.Net.ResourceHandler" />

        <add name="HttpPost" />

        </handlers>

      </protocols>

    </system.webServer>

    </webServices>

</configuration>

    <customErrors mode="Off">

 

      <error statusCode="404" redirect="~/404.aspx" />

 

    </customErrors>

6.打开default.aspx。顶部添加:

    <compilation targetFramework="4.0" debug="true">

 

      <assemblies>

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

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

 

      </assemblies>

 

    </compilation>

7.页面<form>中添加:

    <authentication mode="Windows" />

 

    <authorization>

<ext:ResourceManager ID="ResourceManager1" runat="server" />

      <allow users="*" verbs="GET,POST,PUT,DELETE" />

 

    </authorization>

 

    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">

8.拖入一个Ext控件到页面。

      <controls>

如:

        <add tagPrefix="src" src="~/HighLighter/HighLighterButton.ascx" tagName="SourceButton" />

 

        <add assembly="Ext.Net" namespace="Ext.Net" tagPrefix="ext" />

<ext:CycleButton ID="CycleButton1" runat="server" ShowText="true" PrependText="View As ">

      </controls>

        <Menu> 

    </pages>

           <ext:Menu ID="Menu1" runat="server">

    <httpModules>

                <Items>

   

                    <ext:CheckMenuItem ID="CheckMenuItem1" runat="server" Text="Text Only" Icon="Note" />

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

                    <ext:CheckMenuItem ID="CheckMenuItem2" runat="server" Text="Html" Icon="Html" Checked="true" />

    </httpModules>

                </Items>

    <httpHandlers>

            </ext:Menu>

      <add path="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler" validate="false" />

        </Menu>

    </httpHandlers>

    </ext:CycleButton>

  </system.web>

  <!--

        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>

    <staticContent>

      <mimeMap fileExtension=".json" mimeType="application/json" />

      <mimeMap fileExtension=".woff" mimeType="application/x-woff" />

    </staticContent>

    <modules>

   

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

    </modules>

    <security>

      <authorization>

        <remove users="*" roles="" verbs="" />

        <add accessType="Allow" users="*" verbs="GET,POST,PUT,DELETE" />

      </authorization>

    </security>

    <validation validateIntegratedModeConfiguration="false" />

    <handlers>

      <add name="DirectRequestHandler" verb="*" path="*/ext.axd" preCondition="integratedMode" type="Ext.Net.ResourceHandler" />

    </handlers>

  </system.webServer>

</configuration>

6.打开页面添加:! 必须的

从工具栏,Ext面板中拖入一个ResourceManger,所有的Ext.NET框架页面都需要首先添加这个ResourceManager。

澳门新浦京娱乐场网站 8


代码:
<ext:ResourceManager ID="ResourceManager1" runat="server" />

7.拖入一个Ext控件到页面。如:
添加一个ViewPort

澳门新浦京娱乐场网站 9


代码:

ext:CycleButton runat="server" ShowText="true" PrependText="View As ">
<ext:Viewport ID="Viewport1" runat="server" Layout="border">

            <Items>

                <ext:Panel runat="server" Collapsible="True" Height="100" Region="North"

                    Split="True" Title="North">

                    <Items>

                    </Items>

                </ext:Panel>

                <ext:Panel runat="server" Collapsible="true" Layout="Fit" Region="East"

                    Split="true" Title="East" Width="175">

                    <Items>

                        <ext:TabPanel runat="server" ActiveTabIndex="0" Border="false"

                            TabPosition="Bottom" Title="Title">

                            <Items>

                                <ext:Panel runat="server" Title="Tab 1">

                                    <Items>

                                    </Items>

                                </ext:Panel>

                                <ext:Panel runat="server" Title="Tab 2">

                                    <Items>

                                    </Items>

                                </ext:Panel>

澳门新浦京娱乐场网站Net安装和选择,安装与利用。                            </Items>

                        </ext:TabPanel>

                    </Items>

                </ext:Panel>

                <ext:Panel runat="server" Collapsible="true" Height="100" Region="South"

                    Split="true" Title="South">

                    <Items>

                    </Items>

                </ext:Panel>

                <ext:Panel runat="server" Collapsible="true" Layout="accordion" Region="West"

                    Split="true" Title="West" Width="175">

                    <Items>

                        <ext:Panel runat="server" Border="false" Collapsed="True" Icon="FolderGo"

                            Title="Item 1">

                            <Items>

                            </Items>

                        </ext:Panel>

                        <ext:Panel runat="server" Border="false" Collapsed="true" Icon="FolderWrench"

                            Title="Item 2">

                            <Items>

                            </Items>

                        </ext:Panel>

                    </Items>

                </ext:Panel>

                <ext:Panel runat="server" Layout="Fit" Region="Center" Title="Center">

                    <Items>

                        <ext:TabPanel runat="server" ActiveTabIndex="0" Border="false" Title="Center">

                            <Items>

                                <ext:Panel runat="server" Closable="true" Title="Tab 1">

                                    <Items>

                                    </Items>

                                </ext:Panel>

                                <ext:Panel runat="server" Title="Tab 2">

                                    <Items>

                                    </Items>

                                </ext:Panel>

                            </Items>

                        </ext:TabPanel>

                    </Items>

                </ext:Panel>

            </Items>

        </ext:Viewport>

8.页面点击右键“在浏览器中查看”效果如下:

澳门新浦京娱乐场网站 10

从此踏上Ext.Net之路

 


 

本文由澳门新浦京娱乐场网站发布于www.146.net,转载请注明出处:澳门新浦京娱乐场网站Net安装和选择,安装与利