Document Selector Case problems with master page

Last post 05-17-2007, 6:05 PM by MITFrog. 3 replies.
Sort Posts: Previous Next
  •  05-16-2007, 7:21 PM 29745

    Document Selector Case problems with master page

    I have taken your example code for a file selector and placed it within a content block on a page that uses a master page.  While the selector portion works, the selected file does not show up in the textbox.
     
    The code on the page (in the <asp:Content></asp:Content> area) is identical to the content between the <body> and </body> tags on another page that does not use the master page.  That works fine - the filename shows up in the text area.
     
    The examples are located as shown below:
     
     
    Your help finding why this does not work would be greatly appreciated.
     
    Regards,
     
  •  05-16-2007, 11:16 PM 29749 in reply to 29745

    Re: Document Selector Case problems with master page

    MITFrog,
     
    with master page: 
     
     document.getElementById("docFld")
     
    Should be changed to:
     
     document.getElementById("ctl00$ContentPlaceHolder1$docFld")
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  05-17-2007, 10:47 AM 29767 in reply to 29749

    Re: Document Selector Case problems with master page

    I tried using ctl00$ContentPlaceHolder1$docFld on the TestFileGrabber.aspx page.  Now the button does not do anything (check it out - I uploaded it).
     
    I note that the CE editor ID is not  ctl00$ContentPlaceHolder1 but  ctl00$ContentPlaceHolder1$Editor1.  I also tried to use  ctl00$ContentPlaceHolder1$Editor1$docFld to no avail.  You can view this case on TestFileGrabber3.aspx.
     
    P.S. (later)  It occurs to me that the problem is NOT that the editor is not being found - the button works just fine.  What is not being found is the textarea.  So, I put the following code in:
     
    document.getElementById('<%=docFld.ClientID %>').value = links[links.length-1].href;
     
    This replaces the "docFld" with a computed value - which includes the ContentPlaceholder...
     
    And, IT WORKS!!!!
     
    You might want to update your example code... :)
     
    Thanks for your help.
     
     
  •  05-17-2007, 6:05 PM 29787 in reply to 29767

    Re: Document Selector Case problems with master page

    OK - it is all working now.  I had a problem with not checking for page.IsPostBack on one of my routines that was causing the text fields to be cleared...
View as RSS news feed in XML