How to set action to External URL in Ajax.BeginForm with ASP.NET MVC

634 Views Asked by At

I want to set action External Service (e.g: https://someservice.com/SaveMessage). However BeginForm function expects Controller and Function name.

I want to set action for different domain(URL) and different controller. I DO NOT want to set action for same domain.

AjaxBeginForm as follows:

@using (Ajax.BeginForm("SaveContactMessage", "Ticket",
new AjaxOptions()
{
    HttpMethod = "POST",
    OnBegin = "ticket.contactMessageSaveBegin",
    OnSuccess = "ticket.contactMessageSaveSuccess",
    OnFailure = "ticket.contactMessageSaveFailure"
}, new
{
    @class = "contact-form",
    id = "contact-form"
}))
{

//  Some Form Inputs

}
0

There are 0 best solutions below