如何在VS2010中编写ExtJs

本文详细介绍如何在Visual Studio 2010中手动集成ExtJS框架,包括添加必要的DLL引用、配置Web.Config文件以及在ASP.NET页面上使用ExtJS组件的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在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

<?xml version="1.0" encoding="utf-8"?>
<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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值