views:

999

answers:

4

In my aspx page:

<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>

I got error message "ext is undefined". Can anyone help me?

+6  A: 

You have to include the js file like

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

before using any of the functions.

rahul
A: 

Include below all three file in your file ext-all.css,ext-base.js,ext-all-debug.js

valli
I added ext-base.js,ext-all-debug.js pages. But i have ext-all.js page only. i dont have ext-all.css page .Can u send that file or any path to download to that file
Dhanraj
I have added ext-all.css pages also. but still i got same error
Dhanraj
+1  A: 

you should download the extjs framework from the site itself and host it locally if you can. http://extjs.com

Jay Garcia
Download the SDK and read the file INCLUDE_ORDER.txt. Also see the example html files.
Jonathan Julian
A: 
  1. Is it possible that you used "ext" somewhere instead of "Ext" (wrong capitalization)?
  2. you don't seem to be closing your functions with "}"

Once you get Ext working, you'll probably want to use the button's client ID instead of the code-behind ID:

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