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

  • DJPixcell

    DJPixcell

    20 NİSAN 2007
  • DragsterMC Gaming

    DragsterMC G

    30 HAZİRAN 2013
  • Tube Time

    Tube Time

    14 Mayıs 2013