Last post Jan 12, 2015 02:34 AM by Archer Wang
Jan 06, 2015 05:58 AM|Zinnia|LINK
I need to set a session in all webservice method call. So I decided to write it in constructor. But I can't assign it in Webservice constructor.
I know (EnableSession = true) is the attribute of WebMethod.
Any other suggestions?
Jan 07, 2015 01:57 AM|Archer Wang|LINK
As you said , you could set the porperty EnableSession = true to achieve your goal.
Below links are about how to use WebMethodAttribute to achieve your goal.
Hope this could be helpful to you.
Jan 07, 2015 02:54 AM|Zinnia|LINK
Thank you. But EnableSession attribute can only set for methods, not for constructors.
Jan 12, 2015 02:34 AM|Archer Wang|LINK
If you want to set Session in constructors, you could refer to the below links. By the way, is your application built by MVC. The examples I provided is related with MVC.