its a compiled public class I have written for a custom section.
Have also noted that it produces the same error in a compile user control that is loaded into the tabpage. How would I reference the current basepage, or convert the system.web.ui.page into a basepage?
I was trying the following as an alternative:
Dim pg As System.Web.UI.Page = HttpContext.Current.Handler Dim bPage As BasePage = CType(pg, BasePage) bPage.ClientTools.ShowSpeechBubble(umbraco.BasePages.BasePage.speechBubbleIcon.success, "Title Text", "Message Text"
but I get the following error:
Unable to cast object of type 'ASP.umbraco_control2k_order_aspx' to type 'umbraco.BasePages.BasePage'.
I'm not sure how to convert the Page into a BasePage. Maybe it has something to do with your custom page - is it inheriting from an umbracoPage? Maybe you can try casting to umbracoPage instead of BasePage.
However, the ShowSpeechBubble is just a wrapper for a javascript method, so if you have a reference to the page perhaps you can just inject some javascript:
Create a speechbubble from a custom class
I am trying to trigger a speechbubble in the Umbraco Admin tools from a custom class.
When I use the following:
I get:
Object reference not set to an instance of an object
I a guessing it's because as it is a class rather than the partial class associated with a user control or page it cannot see the current base page.
How can this be achieved?
Thanks,
Simon
Hi,
I'm not sure you'll be able to do this without a reference to the page. What type of class is this being called from?
-Tom
Hi Tom,
its a compiled public class I have written for a custom section.
Have also noted that it produces the same error in a compile user control that is loaded into the tabpage. How would I reference the current basepage, or convert the system.web.ui.page into a basepage?
I was trying the following as an alternative:
but I get the following error:
Unable to cast object of type 'ASP.umbraco_control2k_order_aspx' to type 'umbraco.BasePages.BasePage'.
Hi,
I'm not sure how to convert the Page into a BasePage. Maybe it has something to do with your custom page - is it inheriting from an umbracoPage? Maybe you can try casting to umbracoPage instead of BasePage.
However, the ShowSpeechBubble is just a wrapper for a javascript method, so if you have a reference to the page perhaps you can just inject some javascript:
-Tom
is working on a reply...