Using FormsAuthentication on webMethod

RAMON

New Member
I have a page that has a comment section. This section communicates to a \[code\]WebMethod\[/code\] in order to insert a new comment. \[code\][WebMethod]public static bool insertComment(string commentString){ //userName validation here string userName = (FormsAuthentication.Decrypt(Request.Cookies[FormsAuthentication.FormsCookieName].Value).Name); return new CommentClass().InsertComment(commentString, userName);}\[/code\]The problem is: "An object reference is required for the non-static field". I know I could send the information from a hidden field, or a \[code\]div\[/code\], however, that information field may be changed easily.So which way could be used to know which user is posting, in server side? thanks a lot!
 
Back
Top