0
    [HttpPost]
    public ActionResult BasicInfStep0( PricingPackModel pricingPackModel)
    {
        bool isEventSaved = false;
        try
        {
            string Zip = pricingPackModel.ZipCode;
            string AccCode = pricingPackModel.CustomerId;
            bool ischeck = pricingPackModel.IsNewAccount;
            isEventSaved = _crmClient.ValidateCodes(Zip, AccCode, ischeck, _authentication, _identity);

            if (isEventSaved)
            {
                return View("BasicInf");
                //return Json(isEventSaved, JsonRequestBehavior.AllowGet);



            }
            else
            {
                //return Json(isEventSaved, JsonRequestBehavior.AllowGet);
                //Console.WriteLine("");
                return Content("<script language='javascript' type='text/javascript'>alert('Enter the proper value for zipcode');</script>");


            }
        }
        catch (Exception)
        {
            throw;
        }


    }

我在我的控制器中使用此代码,它正在显示警报消息,但是如果我单击OK按钮,它不会返回到原始屏幕,它只是显示一个白屏。

请帮我。

4

1 回答 1

1

如果一切都与javascript结果有关,那么您也可以尝试一下

else
{
    return new JavascriptResult { Script = "alert('Enter the proper value for zipcode');" };
}
于 2013-05-24T04:55:40.020 回答