This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.
Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.
Before posting questions here you might want to review the developer documentation.
I am creating a control that may be used several times on a page. This control uses JavaScript and I came to the conclusion that in order for the controls not to step on each other I would dynamically render the JavaScript. Doing this, will allow me to name the methods and variables uniquely and avoid naming conflicts. The JavaScript is not that big so I don't mind if there are two versions of an "onclick" event or something similiar.
Well, anyway, when I use the control I am getting errors like "null" values for objects and also errors telling me "Sys is not defined", which means my JavaScript is being placed before the Ajax Library.
Now, if I take the JavaScript that is dynamically rendered and cut-and-paste it into my control and then NOT use the dynamically rendered JavaScript, the control works fine.
I guess my question is, is there a way to control where your dynamically rendered JavaScript is placed in the page?
To dynamically add your script use ScriptManager.RegisterStartupScript that will put your script at the bottom.
Hope that helps,
Joe
Thank you!