I have a razor script (along with some .NET & MySQL queries) and would like to render it once the document has fully loaded (currently the rendered data is displayed at the top of the page). I've been led to .NET's event handlers but when I use them in my code only plain text is rendered and the script does not run, is there something I need to reference to run the event handlers? Or is there are a razor version of say, 'Page_Load'?
Following some documentation, an example of the event handler I have been using (which doesn't work):
Render script once document has loaded
Hi Everyone,
I have a razor script (along with some .NET & MySQL queries) and would like to render it once the document has fully loaded (currently the rendered data is displayed at the top of the page). I've been led to .NET's event handlers but when I use them in my code only plain text is rendered and the script does not run, is there something I need to reference to run the event handlers? Or is there are a razor version of say, 'Page_Load'?
Following some documentation, an example of the event handler I have been using (which doesn't work):
Kind Regards,
mmmoustache
Hi mmmoustache,
I believe in 4.7 or 4.7.1 they added the RenderEvent attribute to macro tags. It's an enum with the following values:
If you set it to Render it might achieve what you're looking to do, but there are no guarantees it will work as expected.
I hope this helps,
Jamie
is working on a reply...