Get reference to the Page object inside a custom FileBrowserContentProvider
## HOW TO
Get reference to the
Page, which hosts the RadFileExplorer control, inside a custom
Page object can be used in several scenarios. Two are given as example:
The second example is useful in scenarios where some additional parameters need to be passed to the implemented custom FileBrowserContentProvider. For example, if an image is uploaded using RadFileExplorer, the size of the image can be explicitly set by using the values of two TextBoxes, declared on the page.
Both scenarios are implemented in the attached projects.
Context object is passed to the content provider. That object contains a property named
CurrentHandler. This handler actually is the
Page object which hosts the RadFileExplorer control. This means that the
Context.CurrentHandler can be cast to a
// Get the Page object which hosts the RadFileExplorer control Page _pageContainsRadFileExplorer = HttpContext.Current.Handler as Page;
' Get the Page object which hosts the RadFileExplorer control Dim _pageContainsRadFileExplorer As Page = TryCast(HttpContext.Current.Handler, Page)
You can find atached the projects demonstrating the described approached here: