Using IFrame

Last post 03-19-2011, 5:59 PM by tirza. 7 replies.
Sort Posts: Previous Next
  •  03-17-2011, 8:58 AM 66716

    Using IFrame

    I have a problem using iframe

    When using an IFrame, hiding the div containing the iframe and show it again, the upload button stop working.
    Reproduce the problem: I added a test page to the demo:
     

    <html xmlns="http://www.w3.org/1999/xhtml" >

    <head runat="server">

    <title>Untitled Page</title>

    </head>

    <body>

    <form id="form1" runat="server">

    <div><input type="button" value="hide" onclick="javacript:hide();" /></div>

    <div id="div1" >

    frame 1<br />

    <iframe src="multiple-files-upload.aspx" height="300px" width="500px"></iframe>

    </div>

    <script type="text/javascript">

    function hide()

    {

    var d1 = document.getElementById('div1');

    if(d1.style.display == '')

    { d1.style.display = 'none';}

    else

    {d1.style.display = '';}

    }

    </script>

    </form>

    </body>

    </html>
     
    How can I solve this problem?
     
    Thanks in advance
    tirza
  •  03-17-2011, 9:51 PM 66729 in reply to 66716

    Re: Using IFrame

    Hi tirza,
     
    Is there any  test page that I can visit,
    I can't reproduce this problem in my local demo
     
    I repeated the hide and show action, the upload button still work fine.
     
    Regards,
    Jeff 
  •  03-18-2011, 10:45 AM 66743 in reply to 66729

    Re: Using IFrame

    I used your demo.
    The code use the page multiple-files-upload.aspx as a source for the iframe.

     just add a web page test.aspx and copy paste to the body this code:
     
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
     <title>Untitled Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
       <div><input type="button" value="hide" onclick="javacript:hide();" /></div>
              <div id="div1" >
                  frame 1<br />
                  <iframe src="multiple-files-upload.aspx" height="300px" width="500px"></iframe>
       </div>
    <script type="text/javascript">
    function hide()
    {
    var d1 = document.getElementById('div1');
    if(d1.style.display == '')
    { d1.style.display = 'none';}
    else
    {d1.style.display = '';}
    }
    </script>
    </form>
    </body>
    </html>
     
    tirza
  •  03-18-2011, 10:07 PM 66752 in reply to 66743

    Re: Using IFrame

    Hi tirza,
     
    Which demo are you testing?
     
    I tested the Framework2.0-CSharp demo, and added your test page
    IIS 7.0 , Classic Application Pool Mode
    It works fine.
     
    Please try the demo by ASP.NET Development again,
    To verify that IIS is ok.
     
    Regards,
    Jeff 
  •  03-19-2011, 12:03 AM 66753 in reply to 66752

    Re: Using IFrame

    I downloaded the recent version (http://cutesoft.net/downloads/15/default.aspx)  in order to evaluate if we can use this product for uploading files.

    Using visual studio I opened the web site under the project:
    Framework 2.0-Csharp-MicrosoftAjax.

    If you add the test page to this project and click hide twice (hide – show) you will see that the browse button of the uploading stop working.
    If I post back (adding dummy button for this purpose to the page), then the functionality of CuteWebUI:UploadAttachments is restored.

    There is no problem using UploadType.IFrame, but obviously this is not a good solution.

    I am using IIS 7, tested it on IE8 + FF 3.6. I also tested a release ver of WebApplication on our server.

    Currently, I am  holding back an upgrade of a system until I can see if we can solve this problem or we should go back to our original upload control.

    Best Regards
    tirza

  •  03-19-2011, 12:35 AM 66754 in reply to 66753

    Re: Using IFrame

    Hi tirza,
     
    I can reproduce this problem on FF 3.6 now
    I'll check it  and get back to you ASAP.
     
    Regards,
    Jeff 
  •  03-19-2011, 12:52 AM 66755 in reply to 66753

    Re: Using IFrame

    Hi tirza,
     
    For your solution,
     
    you can use style.visibility property to control the div's show and hidden instead of style.display property
    I tested the code below, and it works fine on firefox 3.6
     
    function hide()
    {
          var d1 = document.getElementById('div1'); 
          if(d1.style.visibility == '')
          {
               d1.style.visibility = 'hidden';
          }      
         else
         {
               d1.style.visibility = '';
         } 
     
     
    Regards,
    Jeff 
     
     
  •  03-19-2011, 5:59 PM 66759 in reply to 66755

    Re: Using IFrame

    Your section solved the problem with the demo and partially in my application.
    After hiding-showing few times in IE8 I started to get error message:
     

    Failed to call javascript OnSilverlightVerify,Microsoft JScript compilation error
    Expected identifier

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; .NET4.0C; OfficeLiveConnector.1.5; OfficeLivePatch.1.3)
    Timestamp: Sat, 19 Mar 2011 08:05:12 UTC


    Message: Unhandled Error in Silverlight 2 Application Microsoft JScript compilation error
    Expected identifier  
    at System.Windows.Browser.HtmlWindow.Eval(String code)
      
    at Silverlight.Uploader.<Browse>b__3()
    Line: 1
    Char: 1
     

    I will try to isolate the problem.

    Is there any public method to re-initialize the uploader? This might me the fattest solution at the moment.

    Regards
    tirza

View as RSS news feed in XML