我是MVC的新手,所以請忽略我的錯誤。我想從控制器調用JavaScript函數,我嘗試着自己並搜索調用JavaScript函數,但沒有找到任何合理的解決方案。請幫忙 這是我的代碼。如何在MVC 4中從控制器調用JavaScript函數?
[AllowAnonymous]
public ActionResult Index()
{
LogisticQuote lq = new LogisticQuote();
if (Request.QueryString["token"] != null)
{
byte[] byteArray = Convert.FromBase64String(Request.QueryString["token"]);
string values = System.Text.Encoding.UTF8.GetString(byteArray);
EdgeMoveService serivice = new EdgeMoveService();
Edge.Move.Common.Status.ServiceStatus serviceStatus = serivice.GetLogisticQuote(values.Split('&')[1].Split('=')[1], String.Empty, new TenantId(values.Split('&')[0].Split('=')[1]), "", 1, 1, new SaveId(values.Split('&')[2].Split('=')[1]), out lq);
if (serviceStatus.IsOkay)
{
TimeSpan difference = (DateTime.Now.Subtract(lq.CreatedTimeStamp));
if (difference.TotalHours <= 24)
{
if (!lq.IsExpire)
{
return View("QuoteDetails", lq);
}
else
{
ViewBag.Message = "alertError('" + String.Empty + "');";
return View("ExpireLinkNotification", lq);
}
}
else
{
return View("ExpireLinkNotification", lq);
}
}
}
return View("Startup", lq);
}