Adding some stuff in the html header for module controls

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.

This forum is for discussing mojoPortal development

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.

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.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
5/14/2011 5:09:16 AM
Gravatar
Total Posts 251

Adding some stuff in the html header for module controls

I want to add some js files in the header of the page where my ascx module is loaded. How can I do that?

I did this in the ascx, this is right?

<%@ Control Language="C#" AutoEventWireup="false" CodeBehind="myname.ascx.cs" Inherits="myname.Web.UI.featurenameModule" %>

<script type="text" src="jQueryCustomScript.js"></script>

<portal:mojoPanel ID="mp1" runat="ser....

.....

5/14/2011 7:22:38 AM
Gravatar
Total Posts 18439

Re: Adding some stuff in the html header for module controls

I would register the script from code as indicated here.

Hope that helps,

Joe

5/15/2011 4:07:13 PM
Gravatar
Total Posts 251

Re: Adding some stuff in the html header for module controls

Oh, I did not see that. Thanks!

I replaced "uniqueidforyourscript" with a guid, is that ok? It works for me

5/17/2011 7:03:33 AM
Gravatar
Total Posts 18439

Re: Adding some stuff in the html header for module controls

A guid would certainly be unique enough, but the idea is really to use a consistent identifier, if you have more than one instance of the control on a page by having the same type and id string it will only add the script once. If you needed it to load the script separate for each instance then you would need different ids in each instance. Typically the id can be some simple string like "myslideshow" or whatever, a guid works but is a little unconventional.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.