this one took me some time to figure out, but I am at a loss to understand what is happening.
I created the following class:
The purpose of this is to use methods in the page instance as data source for controls (in this case a RadGrid). This caused the web resource to stop loading, causing datepickers, timepickers etc to stop working (and the dreaded "Sys is not defined" and "Telerik" is not defined" javascript errors).
Can anyone spot what I may have violated to cause this behaviour?
I created the following class:
/// <summary> |
/// A data control to reference a method in the current page instance. |
/// </summary> |
public class PageMethodDataSource:ObjectDataSource |
{ |
public PageMethodDataSource() |
{ |
ObjectCreating += OnObjectCreating; |
} |
protected override void OnInit(System.EventArgs e) |
{ |
base.OnInit(e); |
TypeName = Page.GetType().BaseType.ToString(); |
} |
void OnObjectCreating(object sender, ObjectDataSourceEventArgs e) |
{ |
e.ObjectInstance = Page; |
} |
} |
The purpose of this is to use methods in the page instance as data source for controls (in this case a RadGrid). This caused the web resource to stop loading, causing datepickers, timepickers etc to stop working (and the dreaded "Sys is not defined" and "Telerik" is not defined" javascript errors).
Can anyone spot what I may have violated to cause this behaviour?