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

  • CZTUTORIALS

    CZTUTORIALS

    28 Ocak 2011
  • Numberphile

    Numberphile

    15 EYLÜL 2011
  • NYLON Video

    NYLON Video

    11 Aralık 2006