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

  • H3Ctic (old channel)

    H3Ctic (old

    23 Mart 2011
  • Philip DeFranco

    Philip DeFra

    16 EYLÜL 2006
  • The Fashion Sight

    The Fashion

    22 AĞUSTOS 2011