xml version="1.0"?>
<configuration>
<system.web>
<httpModules>
<add name&#61;"DirectRequestModule" type&#61;"Ext.Net.DirectRequestModule, Ext.Net" />
httpModules>
<compilation debug&#61;"true" targetFramework&#61;"4.0">
<assemblies>
<add assembly&#61;"System.Design, Version&#61;4.0.0.0, Culture&#61;neutral, PublicKeyToken&#61;B03F5F7F11D50A3A"/>
assemblies>
compilation>
system.web>
configuration>
下来看看一个简单的录入界面布局。
在aspx文件源视图中修改页面代码如下:
<%&#64; Page Language&#61;"C#" AutoEventWireup&#61;"true" CodeBehind&#61;"WebForm1.aspx.cs" Inherits&#61;"Chapter1.WebForm1" %>
<%&#64; Register Assembly&#61;"Ext.Net" Namespace&#61;"Ext.Net" TagPrefix&#61;"ext" %><%--必须有--%>
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns&#61;"http://www.w3.org/1999/xhtml">
<head runat&#61;"server">
<title>布局示例title>
head>
<body>
<form id&#61;"form1" runat&#61;"server">
<ext:ResourceManager ID&#61;"ResourceManager1" runat&#61;"server" /><%--必须有--%>
<ext:Viewport ID&#61;"Viewport1" runat&#61;"server" Layout&#61;"FitLayout"><%--Layout&#61;"FitLayout" 拉伸布局--%>
<Items>
<ext:FormPanel runat&#61;"server" Frame&#61;"true" LabelWidth&#61;"40"><%--LabelWidth&#61;"40" Label宽40&#xff0c;根据Label文字总宽度手动设定--%>
<Items>
<ext:Container ID&#61;"Container1" runat&#61;"server" Layout&#61;"Column" Height&#61;"106" LabelAlign&#61;"Left">
<Items>
<ext:Container ID&#61;"Container2" runat&#61;"server" ColumnWidth&#61;".5" Layout&#61;"FormLayout" LabelWidth&#61;"40"><%-- Layout&#61;"FormLayout" Form布局,ColumnWidth&#61;".5" 列宽50% --%>
<Items>
<ext:TextField runat&#61;"server" ID&#61;"txtName" FieldLabel&#61;"姓名" AnchorHorizontal&#61;"95%"/><%--AnchorHorizontal&#61;"95%",总体宽95% --%>
<ext:RadioGroup runat&#61;"server" ID&#61;"rdoSex" FieldLabel&#61;"性别">
<Items>
<ext:Radio runat&#61;"server" ID&#61;"rdoSexMen" BoxLabel&#61;"男士" />
<ext:Radio runat&#61;"server" ID&#61;"rdoSexWoman" BoxLabel&#61;"女士" />
Items>
ext:RadioGroup>
<ext:NumberField runat&#61;"server" ID&#61;"numAge" MinValue&#61;"1" FieldLabel&#61;"年龄" AnchorHorizontal&#61;"95%" />
<ext:TextField runat&#61;"server" ID&#61;"txtEmail" AllowBlank&#61;"false" FieldLabel&#61;"邮箱" AnchorHorizontal&#61;"95%" />
Items>
ext:Container>
<ext:Container ID&#61;"Container3" runat&#61;"server" ColumnWidth&#61;".5" Layout&#61;"FormLayout" LabelWidth&#61;"40">
<Items>
<ext:TextField runat&#61;"server" ID&#61;"txtCode" FieldLabel&#61;"编码" AnchorHorizontal&#61;"100%" />
<ext:TextField runat&#61;"server" ID&#61;"txtTl" FieldLabel&#61;"电话" AnchorHorizontal&#61;"100%" Disabled&#61;"true" />
<ext:ComboBox runat&#61;"server" ID&#61;"cmbProvince" FieldLabel&#61;"省份" AnchorHorizontal&#61;"100%" Editable&#61;"false" AllowBlank&#61;"false" />
<ext:DateField runat&#61;"server" ID&#61;"dfBirthDay" FieldLabel&#61;"生日" AnchorHorizontal&#61;"100%" Editable&#61;"false" AllowBlank&#61;"false" Format&#61;"yyyy-MM-dd" />
Items>
ext:Container>
Items>
ext:Container>
<ext:HtmlEditor runat&#61;"server" ID&#61;"txtIntro" AllowBlank&#61;"true" FieldLabel&#61;"简介" AnchorHorizontal&#61;"100%" AnchorVertical&#61;"-106" />
<%--AnchorVertical&#61;"-106" 缩回了106px,高度&#61;页面总高-106,与Container1的Height对应,也就是此控件上面的总高度 --%>
Items>
ext:FormPanel>
Items>
ext:Viewport>
form>
body>
html> 转自&#xff1a; http://www.cnblogs.com/goga21cn/archive/2011/06/19/ExtNetExample1.html