asp.net mvc - MVC4 Ajax Form URL -
is there way set url asp.net-mvc-4 ajax form? looking answer using ajax.beginform()
syntax can make use of microsoft's model construction sorcery without needing re-parse url string myself.
there partial view lives on foo.com.au/getfoo
has ajax form in it. ajax form post foo
controller (default), getfoo
action.
when calling external site (bar.com.au
) want post foo.com.au/getfoo
. instead posting bar.com.au/getfoo
. there way tell ajax form post full url instead of relative path?
motive
of suspect hax0rz or other foul play, have built widget being integrated across multiple client sites. building authentication plugin widget. widget not redirect them website authentication, therefore want post domain results of username/password input form.
you need pass in through ajax-options instead of supplying in overloaad of beginform:
@using (ajax.beginform( new ajaxoptions { url = url.action("getfoo", "foo", null, request.url.scheme) })) { ... }