Do I have to call this from within page load? OR can I do something like this in my .aspx page:
<%=SomeClass.RegisterMyScript(this, (int)Code.Home, UserId, "Home", 0, "", 0, 0, "" ) %>
I’ve got this at the bottom of my .aspx page.
The method RegisterMyScript has the following inside it:
if (!page.ClientScript.IsClientScriptBlockRegistered("cartScript"))
page.ClientScript.RegisterClientScriptBlock(typeof(Page), "cartScript", finalScript);
I do’nt know if by the time the page has already rendered if this will still work. My guess is that I’m required to do it in page init or load but thought maybe I can still do it outside those initial load functions.
That should work within your page, but not 100% sure why you would need to do it that way.
If you are having problems, we would need to see the full method.