PDA

View Full Version : MVC.NET failuretype connect



YankeeImperialistDog
9 Nov 2009, 5:14 PM
I think i understand what the issue is. the controler is not being found. I think.
I have a seprate js file with the form and it renders in a div tag. If i point it to the home controller it finds the home controler, but if i point it to the person controller i get the error noted in the title: failuretype connect. this is a sinple form and i'll post the code below. I really like to know how to see what is wrong. I am wnew at this so i'm sure it's simple.

Ext.onReady(function() {
var firstNameTextField = new Ext.form.TextField({
fieldLabel: 'First Name',
name: 'firstName'
});
var lastNameTextField = new Ext.form.TextField({
fieldLabel: 'Last Name',
name: 'lasttName'
});
var form = new Ext.form.FormPanel({ //(1)
renderTo: 'myDivId', //(2) Ext.getBody()
url: 'Person/Create',
frame: true,
title: 'Please enter your name',
width: 400,
items: [
firstNameTextField,
lastNameTextField
],
buttons:[{
id: 'submit_button',
text: 'Submit',
handler: function(){
form.getForm().submit({ url: '/Person/Create',
waitMsg:'Saving Data...',
success: function (form, action) {Ext.MessageBox.alert('Message', 'Saved OK');},
failure: function(form, action) {Ext.MessageBox.alert('Message', 'Save failed');}
});
}
},
{
text: 'Reset',
type: 'reset',
handler: function(){ form.getForm().reset();}
}
]
});
});

MiamiCoder
9 Nov 2009, 8:59 PM
I suggest that you test all your MVC routes first. Once you know they are OK, hook up your Ext code.

YankeeImperialistDog
10 Nov 2009, 6:45 AM
I agree. Where would i find a simple basic example of a unit test for routes. There are a lot of unit test examples, but very little simple basic examples routing tests. I'm not seeing one in the Nerd dinner or advanced nerd dinner. Any link to a simple example would be appreciated.

MiamiCoder
10 Nov 2009, 9:29 AM
I don't have an example handy, but you can search the asp.net sites, for example.

If it's only a few, you can test manually. You can also roll out your own test. A simple class or just a method that performs http requests against each of your urls.

YankeeImperialistDog
10 Nov 2009, 11:40 AM
http://coderaptor.wordpress.com/

This was created just a few hours ago. Very grateful I am!