无论如何,他们 return actionResult 中没有任何内容,如果出现验证则不刷新该页面

is their anyway to return nothing in actionResult not to refresh that page if validations raised

这是我的操作结果

   [HttpPost]
    [AllowAnonymous]
    [ValidateAntiForgeryToken]
    public ActionResult Payment(PaymentViewModel payment, string returnUrl)
    {
        PaymentModel paymentModel = new PaymentModel();
        if (ModelState.IsValid)
        {                               
            CreditCardDetailsModel creditCardDetailsModel = new CreditCardDetailsModel();
            creditCardDetailsModel.SecurityId = payment.SecurityId;
            creditCardDetailsModel.ExpiryDate = payment.Month + payment.Year;
            creditCardDetailsModel.CardNumber = payment.CardNumber;
            paymentModel.CreditCardDetails = creditCardDetailsModel;
            TempData["model"] = paymentModel;
               return RedirectToAction("Payment");

        }

        var query = from state in ModelState.Values
                    from error in state.Errors
                    select error.ErrorMessage;

        var errorList = query.ToList();
        TempData["ErrorMessages"] = errorList;
        ViewBag.MonthList = new SelectList(new[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" });

        return new EmptyResult();
    }

这是我的局部视图

  @model Centra.Web.ViewModels.PaymentViewModel   @using (Html.BeginForm("Payment", "Flight", FormMethod.Post,null))
{
    @Html.AntiForgeryToken()
    <div class="row space-form traveller-form">
        <div class="col-lg-12">
            <div class="col-lg-3 row">
                <div class="fomr-group text-right">
                    <label>Credit Card No</label>
                </div>
            </div>
            <div class="col-lg-8">
                <div class="fomr-group col-lg-5 cardDetails">
                    @Html.TextBoxFor(p => p.CardNumber, new { @class = "form-control" })
                </div>
                <div ng-if="creditCardError == true" class="fomr-group col-lg-2 cardDetails">
                    <label>Please enter valid card number</label>
                </div>
            </div>
        </div>
        <div class="col-lg-12">
            <div class="col-lg-3 row">
                <div class="fomr-group text-right">
                    <label>Expiry Date</label>
                </div>
            </div>
            <div class="col-lg-8">

                <div class="fomr-group col-lg-2 cardDetails ">
                    @Html.DropDownListFor(m=>m.Month, (SelectList)ViewBag.MonthList)                  
                </div>
                <div class="fomr-group col-lg-3 cardDetails row">               
                    @Html.DropDownListFor(p => p.Year, Enumerable.Range(DateTime.Now.Year, 20)
                    .Select(x => new SelectListItem
                    {
                        Text = x.ToString(),
                        Value = x.ToString()
                    }
         ), new { @class = "form-control" })  
                </div>
            </div>
        </div>
        <div class="col-lg-12">
            <div class="col-lg-3 row">
                <div class="fomr-group text-right">
                    <label>Name on card</label>
                </div>
            </div>
            <div class="col-lg-8">

                <div class="fomr-group col-lg-5 cardDetails">
                    @Html.TextBoxFor(p => p.NameOnCard, new { @class = "form-control" })                       
                </div>
            </div>
        </div>
        <div class="col-lg-12">
            <div class="col-lg-3 row">
                <div class="fomr-group text-right">
                    <label>CVV</label>
                </div>
            </div>
            <div class="col-lg-8">
                <div class="fomr-group col-lg-2 cardDetails">
                    @Html.TextBoxFor(p => p.SecurityId, new { @maxlength = "4", @class = "form-control", @placeholder = "CVV" })
                </div>
                <div class="fomr-group col-lg-5 cardDetails TotalPrice">
                    <label>The 3 digit number printed on the back of card</label>
                </div>
            </div>
        </div>
        <div class="col-lg-12 terms-conditions">
            <div class="col-sm-11 col-lg-offset-1">
                <div class="checkbox">
                    <label>
                       @* @Html.CheckBox("paymentCheckbox", new { @onclick = "function-to-open-dialog()" })*@
                        <input type="checkbox" id="paymentCheckbox" ng-model="paymentCheckbox">
                        I understand and agree to the rules and notifications of this fare, the booking privacy policy and the terms & conditions Centra Travels.
                    </label>
                </div>
            </div>
        </div>


        <div class="col-lg-12">
            <div class="col-lg-2 row">
                <div class="fomr-group text-right">
                </div>
            </div>
            <div class="col-lg-9 row">
                <div class="fomr-group TotalPrice">
                    <label>
                        <h3>$ 36,613</h3>
                        <span>(Total inclusive all taxes)</span>
                    </label>
                </div>
            </div>
        </div>


        <div class="col-lg-12">
            <div class="col-lg-2 row">
                <div class="fomr-group text-right">
                </div>
            </div>
            <div class="col-lg-2 row">

                <div class="fomr-group text-right col-lg-2">
                    @*<button type="submit" ng-disabled="!paymentCheckbox" ng-click="Payment(PaymentDetails)" class="btn btn-info makePaymentbtn">Make a Payment</button>*@
                    <button type="submit" ng-disabled="!paymentCheckbox" class="btn btn-info makePaymentbtn">Make a Payment</button>
                </div>
                @Html.Hidden("returnUrl", this.Request.RawUrl)
            </div>

        </div>
    </div>
}

而其他部分页面不在 mvcRazor 中,它们在 angular 中,所以当我重定向到特定视图(FlighBooking)//FlightBooking 是我的主视图,因为多个部分视图是它们的,它正在渲染具有但 angular 部分视图的 FlightBooking View 正在丢失其状态,因此我尝试通过 returning 作为 return new EmptyResult();但是页面状态正在丢失,我该怎么办? 如果验证失败,我想在同一页面上蜜蜂而不丢失其状态

如果您不想在执行操作后刷新页面,您应该使用 @Ajax.BeginForm 而不是 @Html.BeginForm。网上有很多教程。