c# - $.post doesn't work on locally deployed site -


i "converted" html website web forms. convert, mean opened website in visual studio 2010, added web.config file allow httppost protocol, , called converted. however, form doesn't want post .aspx page. missing? when build app, there no binary created deploy local iis (7.5 on windows 7)

<form name="register2" method="post" action="#" onsubmit="return false;"> 

then $.post in $(function() {...

$('form[name="register2"]').submit(function () {     var $registerform2 = $('form[name="register2"]');     if ($registerform2.valid()) {         $.post({             type: 'post',             url: 'createaccount.aspx',             data: $(this).serialize()         });     } else { //do validation         $registerform2.validate();     } }); 

when submit form, chrome tells me request url url:http://localhost/mysite/[object%20object] , receives error code 404. page createaccount.aspx exist.

i see problem now. $.post() method doesn't support taking options object parameter.

from documentation:

$.post('ajax/test.html', function(data) {   $('.result').html(data); }); 

so change code be:

 $.post( 'createaccount.aspx', $(this).serialize() ); 

and give try.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -