Quantcast lập trình ext.net với visual studio 2010

lập trình ext.net với visual studio 2010

by Neon Quach 1. May 2011 23:17

Ext.net 1 bộ công cụ mã nguồn mở giúp chúng ta có thể xây dựng website có giao diện hấp dẫn và thân thiện với người dùng, hôm nay mình sẽ hướng dẫn tất cả các bạn từng bước từ việc download và sử dụng Ext.Net để xây dựng website.

Download version mới nhất của Ext.Net tại đây version hiện tại là ext.net.community.1.0rc1.zip

Sau khi download về và tiến hành giải nén, chúng ta có các file:

Ext.Net.dll

Ext.Net.Utilities.dll
Ext.Net.xml
Newtonsoft.Json.dll
Newtonsoft.Json.xml

Tiến hành tạo 1 blank asp.net website sử dụng visual studio, sau đó thêm mới trang Default.aspx, thêm thư mục Bin vào website và copy tất cả *.dll vừa giải nén vào folder Bin đó.

Click chuột phải vào website → chọn add reference.... và chọn các *.dll bên trên.



Add Ext.net vào toolbox:

Click chuột phải vào toolbox chọn Choose Items...Sau đó chọn Ext.Net.dll trong Bin folder → OK

Cấu hình trong web.config:

<?xml version="1.0"?>

 

<!-- 

  For more information on how to configure your ASP.NET application, please visit 

  http://go.microsoft.com/fwlink/?LinkId=169433 

  --> 

 

<configuration>

  <configSections>

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

  </configSections>

  <system.web>

    <compilation debug="false" targetFramework="4.0" />

  </system.web>

  <!--

        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="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler" validate="false" />

    </httpHandlers>

    <httpModules>

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

    </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="DirectRequestModule"

          preCondition="managedHandler"

          type="Ext.Net.DirectRequestModule, Ext.Net"

                />

    </modules>

    <handlers>

      <add

          name="DirectRequestHandler"

          verb="*"

          path="*/ext.axd"

          preCondition="integratedMode"

          type="Ext.Net.ResourceHandler"

                />

    </handlers>

  </system.webServer>

</configuration>

 
Thêm control vào website:
Mở trang Default.asxp thêm vào code sau:
Đăng ký assembly

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


Bỏ code sau vào tag body:

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


add control ext.net:

    <div>

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

            <Menu>

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

                    <Items>

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

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

                    </Items>

                </ext:Menu>

            </Menu>

        </ext:CycleButton>

    </div>


Nhấn F5 để run website lên và xem kết quả

Tags: ,


Categories: ext.net | visual studio 2010

blog comments powered by Disqus

About me

I'm  currently employed as Software developer at devinition.com and also a Microsoft Certified Technology Specialist (MCTS), Microsoft Certified Professional Developer (MCPD) in Net Framework 2.0 and 3.5: Web Applications and MCTS .NET Framework 3.5, ADO.NET Applications

Powered by BlogEngine.NET 2.5.0.5 - Eco Theme by n3o Web Designers