Frage

Wer weiß, wie HttpRequest.Cookies innerhalb einer statischen Methode für den Zugriff auf mit [WebMethod] Attribute von einer aspx.cs Seite?

Es wird ich es nicht zulassen, weil Methode statisch ist.

[WebMethod]
public static bool PostToTwitter(string identityUrl, string message, bool autoFollow)
{
  Page.Request.Cookies -- object reference is required for non-static field

Danke!

War es hilfreich?

Lösung

Die Verwendung,

HttpContext.Current.Request.Cookies
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top