I have a problem I am hoping someone may be able to help with. I have a page that is dependent on various external sources. To avoid a slow page load time, I am trying to load the information from the external sources asynchronously. Very simply, I have the following:
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Page.RegisterAsyncTask(New PageAsyncTask(AddressOf LoadInfo))
End Sub
Private Async Function LoadInfo() As Task
Await Task.Run(Sub()
' Blah blah blah
End Sub)
End Function
Outside of Umbraco, this works perfectly however, when I run this within Umbraco, I get the following:
Additional information: This operation requires the page to be asynchronous (the Async attribute must be set to true).
I am new to Umbraco but I can't see anywhere within the CMS to alter the page parameters. From what I can see, pages inherit from Masterpages which don't have the Async parameter...
In short, am I able to somehow set the Async'"true" page parameter somewhere?
I ran into this issue a few years back when I was working in Web Forms. TBH I cant fully remember how I resolved.
The MasterPage that Umbraco Templates inherit from can be found in
/umbraco/masterpages/default.Master
However you can't add Async="true" on a master it needs to be set at the page level.
Try add it to the declaration on that default.aspx page in the root as this is the page that Umbraco loads for every request. Be aware though that you are essentially modifying the core although only in a minor way but just make sure that if you upgrade in the future you remember you did this.
Async="true"
I have a problem I am hoping someone may be able to help with. I have a page that is dependent on various external sources. To avoid a slow page load time, I am trying to load the information from the external sources asynchronously. Very simply, I have the following:
Outside of Umbraco, this works perfectly however, when I run this within Umbraco, I get the following:
Additional information: This operation requires the page to be asynchronous (the Async attribute must be set to true).
I am new to Umbraco but I can't see anywhere within the CMS to alter the page parameters. From what I can see, pages inherit from Masterpages which don't have the Async parameter...
In short, am I able to somehow set the Async'"true" page parameter somewhere?
Any pointers greatly appreciated.
Hey Jason
I ran into this issue a few years back when I was working in Web Forms. TBH I cant fully remember how I resolved.
The MasterPage that Umbraco Templates inherit from can be found in
/umbraco/masterpages/default.Master
However you can't add Async="true" on a master it needs to be set at the page level.
Try add it to the declaration on that default.aspx page in the root as this is the page that Umbraco loads for every request. Be aware though that you are essentially modifying the core although only in a minor way but just make sure that if you upgrade in the future you remember you did this.
So simple! Just what I was after - thanks Peter.
is working on a reply...