如何在VS2010中编写ExtJs
在vs2010的工程,在工具栏里添加新的选项卡,把Dll拖到上面并没有出现extjs工具按钮。
现在把手动添加extjs介绍如下:
首先,要在工程里面添加对一下三个dll的引用,这里用的是ext3.0。
Ext.Net.dll
Ext.Net.Utilities.dll
Newtonsoft.Json.dll
其次,在webconfig添加配置项
<system.web>
<httpHandlers>
<add path="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler"
validate="false" />
</httpHandlers>
</system.web>
配置Web.Config
<configuration>
<configSections>
<section name="extnet" type="Ext.Net.GlobalConfig" requirePermission="false"/>
<configSections>
<extnet />
<!--
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>
再者,在aspx页面中添加
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MonitorInfo.aspx.cs" Inherits="DCMWeb.MonitorInfo" %>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
网页代码
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
html, body {
height: 100%;
overflow:hidden;
}
body {
padding: 0;
margin: 0;
}
</style>
</head>
<body >
<form id="form1" runat="server" style="height:100%; width:100%; margin:0; padding:0; ">
<ext:ResourceManager runat="server" />
<ext:Viewport runat="server" Layout="border">
<Items>
<ext:Panel runat="server" Region="Center" BodyBorder="false" Border="false">
<Content>
</Content>
</ext:Panel>
<ext:Panel
runat="server"
BodyBorder="false"
Border="false"
Region="South"
Split="false"
Collapsible="false"
Height="30"
Padding="0"
>
<Content>
</Content>
</ext:Panel>
</Items>
</ext:Viewport>
</form>
</body>
</html>
红色部分代码是必须要添加的部分,这样就可以写自己的代码啦