我在 ASP.NET 页面中尝试使用 Ext JS 3 表单,但我的表单加载到了 ASP 页面的“BodyContent”之外。我试过: renderTo: Ext.get('BodyContent') 但它不起作用。我的带有 Ext 代码的 asp 页面:
<%@ Page Title="Forms" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="Forms.aspx.cs" Inherits="ExtJSDemo.Forms" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<link rel="stylesheet" type="text/css" href="ext-3.4.0/resources/css/ext-all.css" />
<script type="text/javascript" src="ext-3.4.0/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext-3.4.0/ext-all-debug.js"></script>
<script type="text/javascript">
if (Ext.BLANK_IMAGE_URL.substr(0, 5) != 'data:') {
Ext.BLANK_IMAGE_URL = 'ext-3.4.0/resources/images/default/s.gif';
}
Ext.onReady(function () {
var movie_form = new Ext.FormPanel({
url: 'movie-form-submit.aspx',
renderTo: Ext.getBody(),
frame: true,
title: 'Movie Information Form',
width: 250,
items: [{
xtype: 'textfield',
fieldLabel: 'Title',
name: 'title'
},{
xtype: 'textfield',
fieldLabel: 'Director',
name: 'director'
},{
xtype: 'datefield',
fieldLabel: 'Released',
name: 'released'
}]
});
});
</script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<!-- I'M EXPECTING MY FORM HERE, BUT IT'S LOADED OUTSIDE BodyContent AT THE BOTTOM OF THE ENTIRE PAGE -->
</asp:Content>
当我使用 renderTo: Ext.get('BodyContent') 我的表单完全没有显示!