Hi all, this may be a general question on sharing variables but here goes.
I'm using a GridView on a webpage to edit each job, and I need to hook up to each 'rowbound' event to get some data from the jobDataMap.
Anyway, the scheduler starts in the Page_Load method (creating the variable sched I can use to access the info), but from any other event/method I can't access the sched variable. How do I allow myself to do this?
Thanks
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType != DataControlRowType.Header)
{
var schedulerFactory = new StdSchedulerFactory();
IScheduler sched = schedulerFactory.GetScheduler();
string schedID = sched.SchedulerInstanceId;
string id = e.Row.Cells[0].Text;
string groupid = e.Row.Cells[1].Text;
JobDetail jobDetail = sched.GetJobDetail(id, groupid);
Trigger[] trigger = sched.GetTriggersOfJob(id, groupid);
JobDataMap dataMap = jobDetail.JobDataMap;
e.Row.Cells[3].Text = dataMap.GetString("nameid");
}
}