Ext.net is a. NET Control library that encapsulates the ExtJS, which can be used in ASP. WebForm and MVC. Starting today to record my study notes, this is the first one, and today I learned how to use the Ext.net Control Library in WebForm.
Download ext.net
First go to ext.net website Download ext.net, I first study is WebForm version:
The current version is 3.1.0, and the compressed package contains different versions, which are used in the corresponding. NET version of the program.
Referencing in projects
To use Ext.net, first create a WebForm program, we use version 4.5 here.
In the reference manager, browse to the extracted directory, and then add the following reference:
Configure Web. config
Despite the addition of references, this is not yet complete. To use ext.net correctly, you also need to modify the Web. config.
The first step is to add the configuration of the HttpHandler and HttpModule nodes
Classic Mode configuration:
"*/ext.axd" verb="*" Type="Ext.Net.ResourceHandler" validate="false" />"directrequestmodule " type="Ext.Net.DirectRequestModule, ext.net" /></ Httpmodules>
Integrated Mode configuration:
<modules> <add name="Directrequestmodule"precondition="Managedhandler"type="Ext.Net.DirectRequestModule, Ext.net"/></modules>"Directrequesthandler"verb="*"Path="*/ext.axd"Precondition="Integratedmode"Type="Ext.Net.ResourceHandler"/>To coexist with Classic mode and integrated mode, you will also need to add the following configuration to the System.webserver node:
<validation validateintegratedmodeconfiguration="false" />
Step two, configure the page controlTo use ext.net controls in a page, you need to add a configuration for the Ext.net control:
<pages> <controls> <add tagprefix="ext"namespace= " ext.net " assembly="ext.net"/> </controls></pages>
Step three, add the Ext.net Global configuration nodeAfter completing the two steps above, we can already use the Ext.net control in the page.
So why do we have a third-step configuration? The third step configuration adds a global configuration, for example we want to use global skins instead of every page to set.
To add a global configuration, you first add a custom node to the configuration file:
<configSections> <section name="extnet" type= " Ext.Net.GlobalConfig" requirepermission="false" /></ Configsections>
Next is the configuration item:
<extnet theme="Neptune" />
Here we only set the global skin, using ExtJS 4.2.1 in the Neptune skin.
Simple usage in the pageOnce the configuration is complete, we can use the Ext.net control in the page.
First, add a resource reference to the page where you want to use the Ext.net control, just as you would with ScriptManager, by adding the following controls to the page:
<ext:resourcemanager runat="server"></ext:ResourceManager>
With this control, we have added a ExtJS reference to the page.
Let's take a look at the code for the example window above:
<ext:window runat="Server"ID="win"Title="extnet Sample window by Webwang"Width=" -"Height=" $"AutoShow="true"></ext:Window>
Then run the page and you can see the example window we just had.
Ext.net Learning Note 01: Using Ext.net in ASP. NET WebForm