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 に答える