I have a simple requirement I seem unable to meet: I have a product page. products have vendors and the vendor input is a text field with an autocomplete. if the user enters a vendor that doesn't exist in the database, I need to add it. to add it I have a DIV on the page which I .load() with a call to my /Vendor/Create controller method. the view for that method uses:
@using (Ajax.BeginForm("Create", "Vendor", new AjaxOptions {
UpdateTargetId = ViewBag.TargetId,
HttpMethod = "Post",
OnSuccess="VendorCreated",
OnComplete="alert('success')"
})) {
which should post my form via ajax, calling Javascript when done. The problem I'm having is that upon submission my whole page gets refreshed such that I end up with /Vendor/Create when I started with /Product/Create. additionally, neither the OnSuccess nor OnComplete get called.
what am I doing wrong here?