2009-11-27 100 views
1

在我的aspx頁面:ext.js未定義

<script type="text/javascript"> 
Ext.onReady(function() { 
    Ext.get('mb1').on('click', function(e) { 
     Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do that?', showResult); 
}); 
function showResult() { 
    Ext.example.msg('test'); 
</script> 

<div> 
<asp:Button ID="mb1" runat="server" Text="Button" /> 
</div> 

我收到錯誤消息 「ext是不確定的」。誰能幫我?

+0

你有沒有包括所有必要的腳本文件? – rahul 2009-11-27 06:12:43

回答

8

你必須包括像

<script type="text/javascript" src="extjs.js"></script> 

JS文件使用任何功能之前。

0

包括以下三個文件在文件 EXT-all.css,EXT-base.js,EXT-ALL-debug.js

+0

我添加EXT-base.js,EXT-ALL-debug.js頁面。但我只有ext-all.js頁面。我沒有ext-all.css頁面。 ü可以發送文件或下載該文件 – Dhanraj 2009-11-27 09:54:35

+0

我已經加入EXT-all.css頁面還任何路徑。但我仍然得到同樣的錯誤 – Dhanraj 2009-11-27 10:01:35

1

你應該下載從網站本身的ExtJS的框架,並在本地主機它如果你可以的話。 http://extjs.com

+0

下載SDK和讀取文件INCLUDE_ORDER.txt。另請參閱示例html文件。 – 2010-02-07 17:22:50

1
  1. 有沒有可能是你使用的 「ext」 的地方,而不是 「Ext」(錯誤市值)?
  2. 你似乎不符合「}

一旦你得到內線工作,你可能會想,而不是使用代碼隱藏ID按鈕的客戶端ID關閉您的功能:

... 
Ext.get('<%=mb1.ClientID%>').on('click', function(e) { 
...