Dhanraj
Dhanraj

Reputation: 75

ext.js is undefined

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?

Upvotes: 1

Views: 8522

Answers (4)

orip
orip

Reputation: 75557

  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) {
...

Upvotes: 1

Jay Garcia
Jay Garcia

Reputation: 76

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

Upvotes: 1

valli
valli

Reputation: 5931

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

Upvotes: 0

rahul
rahul

Reputation: 187110

You have to include the js file like

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

before using any of the functions.

Upvotes: 8

Related Questions