0

I'm using CKFinder 2.5.0.1 for ASP.NET. Everything works fine except the most important is Select file . When we click to Select file command or double click , nothing happens. CKFinder photo

<asp:Button runat="server" ID="btnQRCode" Text="Browse Server" OnClientClick=" BrowseServer('Images:/', '<% =txtQRCode.ClientID %>'); "/>
            <asp:TextBox ID="txtQRCode" runat="server" Width="1px" Style="display: none;"></asp:TextBox>

and Js :

function BrowseServer(startupPath, functionData) {
var finder = new CKFinder();
finder.basePath = '../';
finder.startupPath = startupPath;
finder.selectActionFunction = SetFileField;
finder.selectActionData = functionData;
finder.popup();

}

function SetFileField(fileUrl, data) {
    document.getElementById(data["selectActionData"]).value = fileUrl;
}

I'm using .NET 4.0 . Upload file is OK but we cannot select file to set the file path to textbox.

Cát Tường Vy
  • 398
  • 6
  • 32
  • Any chance that CKFinder and CKEditor are running on two different domains (or at least ports)? Looks like a cross domain issue. You may want to check error console in a browser. – Wiktor Walc Oct 14 '15 at 15:27
  • With the same code , other page is working but this page cannot ? I cannot find out the problem . So my question is why it only work on specific page with same code. – Cát Tường Vy Oct 14 '15 at 16:25
  • Ah, disregard my comment, just quickly scanned the questions and thought it's the case as usual where CKEditor is connected with CKFinder and they are running on different domains. Here you have your own selectActionFunction, so of course no cross domain issues are to be blamed. Regarding the problem, I see that the element has ` Width="1px" Style="display: none;` - isn't it the reason why nothing happens, because you cannot see it? Also check the browser error console, dump the value of `data["selectActionData"]`, if it is a string, make sure that element with such ID is present on the page. – Wiktor Walc Oct 15 '15 at 08:22
  • It worked with this modification:` ` – Cát Tường Vy Oct 18 '15 at 03:38

0 Answers0