SORU
9 Temmuz 2010, Cuma


Nasıl Temel Denetleyicisi OnActionExecuting içinde yönlendirmek?

İki yol denedim: Yanıt.Hiçbir şey gibi bir ActionResult döndüren ve RedirectToAction getiri sağlayan Temel Denetleyicisi içinde yeni bir yöntem arama yapar), yönlendirme()... ne bu iş.

Nasıl OnActionExecuting yöntemini bir yönlendirme yapabilirim?

CEVAP
9 Temmuz 2010, Cuma


 public override void OnActionExecuting(ActionExecutingContext filterContext)
 {
    ...
    if (needToRedirect)
    {
       ...
       filterContext.Result = new RedirectResult(url);
       return;
    }
    ...
 }

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Kap Slap

    Kap Slap

    8 Mart 2010
  • Samvith V Rao

    Samvith V Ra

    20 EKİM 2006
  • Tianna Sierra Dance

    Tianna Sierr

    16 EYLÜL 2013