More in this section

Forums / Developing with Sitefinity / Display Document within page

Display Document within page

34 posts, 0 answered
  1. David Meyer
    David Meyer avatar
    13 posts
    Registered:
    29 Oct 2009
    15 Feb 2010
    Link to this post
    Sorry, I dont want to save the html content of a document into the events page (that seems to be what that contol you suggested would do). I want to save a document to a document library and on the event page using a custom meta field then on the display side show a link to the document which pulls it from the document library. The only thing is that when you select a document, you are prompted to enter the name of the link to the document (please take a look at the screenshot  I sent).  Right now Im showing the document name as the link, but the client doesnt want that, they want the name they entered on the second  step. I cant seem to find it in the document library data.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    15 Feb 2010
    Link to this post
    Hello David Meyer,

    That value that a person enters into the text box is what Im trying to get.

    Open  ~/Sitefinity/Admin/ControlTemplates/Libraries/Dialogs/DocumentEditorDialog.ascx. In this template there is an ASP.NET Panel control with ID="editHolder". Inside the panel you will find TextBox control with ID="titleTxt". You can access the TextBox and get the Text property.

    You can use JS code

    function insertLink() //fires when the Insert Link button is clicked
        {
            var closeArgument = currentElement;
            selValue = document.getElementById('<%= selectedValueField.ClientID %>')
            editHolder = document.getElementById('<%= editHolder.ClientID %>');
            titleField = document.getElementById('<%= titleTxt.ClientID %>');
            alert(titleField.value);
             }

    or Server side code

    1. Modify the a tag - add runat="server" and then subscribe for onserverclick

    <a href="#" runat="server" onserverclick="ServerClick" onclick="insertLink();" class="CmsButLeft ok"><strong class="CmsButRight light">Insert</strong></a>

    2. Find the TextBox inside the Panel control.

    public void ServerClick(object sender, EventArgs e)
       {
           TextBox tb = (TextBox)this.editHolder.FindControl("titleTxt");
           if (tb != null)
           {
               string txt = tb.Text;
           }
       }


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. hugh schmidt
    hugh schmidt avatar
    1 posts
    Registered:
    08 Mar 2010
    02 Apr 2010
    Link to this post
    I saw your recommendation to use <!--#include file="filnam.inc"--> in the header. 

    We would like to able to use this in containers.   I tested the path with and <IMG... file and that works fine.  But the #include directive doesn't work.  Do we need to embed it in javascript?

    <img src="../App_Themes/PSerc/images/left-list-bullet.png" />
    <!--#include file="../includes/cphLeftNav.inc" -->

    The goal is to let people updated page info by uploading a file to the server via ftp.  Is there another way other than editing the template?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    04 Apr 2010
    Link to this post
    Hi hugh schmidt,

    You could create a custom user control that have public properties and gets data from some location or just the user can set the value of the public property. For each public property you could set default location where the control will look for a file. You could take a look at Anderei's post from 5/20/2009

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
34 posts, 0 answered
1 2