SORU
22 ŞUBAT 2011, Salı


Nasıl MVC 3 denetleyici ASP.NET 200 HTTP Durum Kodu dönmek

Üçüncü parti bir hizmet SONRASI veri kabul eden bir uygulama yazıyorum.

Bu veri gönderildiğinde 200 HTTP Durum Kodu dönmek zorundayım.

Nasıl benim denetleyicisi bu yapabilirim?

CEVAP
1 ŞUBAT 2012, ÇARŞAMBA


Kumandanız böyle bir HttpStatusCodeResult döneceğini...

[HttpPost]
public ActionResult SomeMethod(...your method parameters go here...)
{
   // todo: put your processing code here

   //If not using MVC5
   return new HttpStatusCodeResult(200);

   //If using MVC5
   return new HttpStatusCodeResult(HttpStatusCode.OK);  // OK = 200
}

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

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • HTC Tutorials

    HTC Tutorial

    21 EYLÜL 2010
  • Marissah Simonini

    Marissah Sim

    25 HAZİRAN 2013
  • Unbox Therapy

    Unbox Therap

    21 Aralık 2010