Hi all,
I'm trying to use the ckFinder from within a Dynamics Data web site. I have it working from within a normal page but cannot get it working from within a control. The problem is that my BrowseServer jscript cannot find the CKFinder object. (object is undefined). What is the proper way to reference the cfinder.js script? All info very welcome.
My code:
I'm trying to use the ckFinder from within a Dynamics Data web site. I have it working from within a normal page but cannot get it working from within a control. The problem is that my BrowseServer jscript cannot find the CKFinder object. (object is undefined). What is the proper way to reference the cfinder.js script? All info very welcome.
My code:
<%@ Control Language="VB" CodeFile="URLPath_Edit.ascx.vb" Inherits="DynamicData_FieldTemplates_URLPath_EditField" %> <%@ Register Assembly="CKFinder" Namespace="CKFinder" TagPrefix="CKFinder" %> <script src="../../ckfinder/ckfinder.js" type="text/javascript"></script> <script type="text/javascript"> function BrowseServer() { // You can use the "CKFinder" class to render CKFinder in a page: var finder = new CKFinder(); //finder.BasePath = '~/ckfinder/' ; // The path for the installation of CKFinder (default = "/ckfinder/"). finder.SelectFunction = SetFileField; finder.Popup(); // It can also be done in a single line, calling the "static" // Popup( basePath, width, height, selectFunction ) function: // CKFinder.Popup( '../../', null, null, SetFileField ) ; // // The "Popup" function can also accept an object as the only argument. // CKFinder.Popup( { BasePath : '../../', SelectFunction : SetFileField } ) ; } // This is a sample function which is called when a file is selected in CKFinder. function SetFileField(fileUrl) { document.getElementById('TextBox1').value = fileUrl; } </script> <asp:TextBox ID="TextBox1" runat="server" Text='<%# FieldValueEditString %>' CssClass="droplist"></asp:TextBox> <asp:Button ID="Browse" runat="server" Text="Browse" OnClientClick="BrowseServer();" />
Re: ckFinder popup from ASPX control