PDA

View Full Version : FormPanel submit in ASP.NET



--miCZar--
20 Nov 2010, 4:19 AM
Is there a way to do submit Form via AJAX in ASP.NET? I mean like this:
formPanel.getForm().submit({
url: '/web/SendMessage.aspx',
success: respHandler,
failure: respHandler
});I can't figure out solution by myself. There is always possibility to do it manualy via Ext.Ajax.request, but I'll use it if standard submit won't work.

griffiti93
20 Nov 2010, 9:40 PM
FormPanel.BasicForm.submit() uses AJAX by default. You can set the "standardSubmit" config property to bypass the AJAX. Your code example above should work just fine.

Perhaps I don't understand your question? If you are asking how to do it via standard ASP.NET, you probably have the wrong forum. There are numerous ways to submit via AJAX in ASP.NET, including certain AJAX-based controls.

--miCZar--
7 Dec 2010, 5:01 PM
You were close. It's not like you don't understand question but it seems you are not familiar with ASP.NET specifics. Generaly ASP.NET wraps whole page body into one big form and only one form per page is allowed. So that is whole buzz about. I know there are projects like Script# and similar but I didn't want to refactor all the code to workaround 1 tiny problem. Finally I did it (as said before) manualy via Ext.Ajax.request and used
if(result.errors) formPanel.markInvalid(result.errors) for attaching server validation errors on form. Hopefuly in next projects I will use ASP.NET MVC so there won't be this kind of problems.