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

  • echifitness

    echifitness

    9 Kasım 2008
  • Engadget

    Engadget

    18 EYLÜL 2006
  • StalkerJS

    StalkerJS

    15 HAZİRAN 2010