Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Include jquery lib in CMSDesk View modes: 
User avatar
Member
Member
seanbun-gmail - 6/24/2009 3:13:54 AM
   
Include jquery lib in CMSDesk
Hi,

I've created a custom form control and make use of jquery. I need to attach the jquery library somewhere in the cmsdesk.

Why don't I include the jquery lib on the form control levell?
The custom form control would be used in a user-contribution form as well. And the user-contribution form is inside a master page which has attached the jquery lib. If I include the jquery lib in form control, I will include the lib twice and throw error.

Now, the form control works well in the user-contribution form but NOT in the CMSDesk. What is the best practice or where should I include the jquery in the CMSDesk?

Cheers,
matt
@seanbun

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 7/1/2009 6:09:23 AM
   
RE:Include jquery lib in CMSDesk
Hello,

You can call the jQuery bin file the following way.

e.g.

this.Page.ClientScript.RegisterClientScriptBlock(
typeof(string), "ShowLargeTextArea", ScriptHelper.GetScript("function ShowLargeTextArea(txtClientID, allowMacros) { modalDialog('" + ResolveUrl("~/CMSFormControls/Selectors/LargeTextAreaDesigner.aspx") + "?areaid=' + txtClientID + (allowMacros ? '' : '&allowMacros=false'), 'ShowLargeTextArea', 1024, 630); return false;}"));

This way the lib file won't be included twice.

Best Regards,
Boris Pocatko