I have a problem with webservice binding of RadScheduler on an ASP.NET forms application. I need to be able to access Session state from my webservice code, and sometimes it works and sometimes it doesn't.
Specifically the client event OnClientResourcesPopulating does not maintain session state - I presume because it's not passing the current session state cookie to the webservice call.
I have set up a sample project showing the problem, which I set up using the example here: http://www.telerik.com/help/aspnet-ajax/scheduler-webservicebinding.html
The key parts are that in my Default.aspx I set a session variable like this:
public partial class Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
Session["TestSessionValue"] = "MyTestValue";
The page has a RadScheduler on it, configured to call a webservice. Here's a snippet from the webservice code:
public IEnumerable<ResourceData> GetResources(SchedulerInfo schedulerInfo)
object v = Session["TestSessionValue"]; //-- THIS RETURNS NULL
Session["WS_GetResourcesCalled"] = true; //-- THIS WORKS BUT NOT VISIBLE IN SUBSEQUENT CALLS
public IEnumerable<AppointmentData> GetAppointments(SchedulerInfo schedulerInfo)
object v = Session["TestSessionValue"]; //-- THIS RETURNS "MyTestValue"
Session["WS_GetAppointmentsCalled"] = true;
As you can see from my comments - it appears that the GetResources
function starts a new session every time it is called, whilst the GetAppointments
function seems to work as expected.
I need to find a solution to this as I have session-based user security and I want to return different things based on which user is stored in the current session.
I can't attach my test solution because it'll only let me post image files - but I can email it to someone if it would help - it's only 19k zipped!