File browsing dialog has been blocked

Last post 03-22-2010, 10:20 AM by Adam. 3 replies.
Sort Posts: Previous Next
  •  03-19-2010, 3:40 AM 59507

    File browsing dialog has been blocked

    Hi,
     
    The error message "File Browsing has been blocked." always appear when I set property  InsertButtonID to, for example Button1 and I colling method Button1.click() from another button for example Button2.
     
    I do this in this way  becouse I want that  AjaxUploaderQueueTable show under button1 and the uploader button (button3) was in another location.
    May be someone from CuteSoft have better solution.
    I just want to find a way to set position of AjaxUploaderQueueTable or just turn it off.
    I work on Win7 x86, VS2008 , flash10, IIS7.
     
    Below I paste sample code.
     
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>
        <script runat="server">
            void InsertMsg(string msg)
            {
                ListBoxEvents.Items.Insert(0, msg);
                ListBoxEvents.SelectedIndex = 0;
            }
            void Uploader_FileUploaded(object sender, UploaderEventArgs args)
            {
                InsertMsg("File uploaded! " + args.FileName + ", " + args.FileSize + " bytes.");

                //Copys the uploaded file to a new location.
                //args.CopyTo("c:\\temp\\"+args.FileName);
                //You can also open the uploaded file's data stream.
                //System.IO.Stream data = args.OpenStream();
            }
    </script>

     
        <style type="text/css">
            #OpenFileUpload
            {
                height: 28px;
                width: 395px;
            }
        </style>

     
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
                       
                  
                  <DIV id = "HiddenDivOpen" style=" Z-INDEX: 5000; left: 530px; top: 86px; height: 293px; width:508px;  overflow:auto; POSITION: absolute;" >
                         <INPUT id="HiddenButtonOpen" style="Z-INDEX: 101; LEFT: 96px;TOP: 0px; HEIGHT: 24px; width: 501px"
                          type="button" name="Button2" runat="server"
                             value="Hiddenn button - I want that AjaxUploaderQueueTable show under this button ">     
                  </DIV>  
                  <input ID="OpenFileUpload" runat="server" onclick="HiddenButtonOpen.click()" style="position: absolute; top: 11px; left: 17px;" type="button"
                        value="I want that Upload button was here" />
        
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div id="divUploder" style="POSITION: absolute; top: 200px;">
                    <h2>
                        Selecting multiple files for upload
                    </h2>
                    <p>
                        Select multiple files in the file browser dialog then upload them at once</p>
                    <CuteWebUI:Uploader runat="server" ID="Uploader1" InsertText="Upload Multiple Files (Max 10M)"
                        MultipleFilesUpload="true" OnFileUploaded="Uploader_FileUploaded" InsertButtonID="HiddenButtonOpen"
                        >
                        <ValidateOption MaxSizeKB="10240" />
                    </CuteWebUI:Uploader>
                    <br />
                    <br />
                    <div>
                        Server Trace:
                        <br />
                        <asp:ListBox runat="server" ID="ListBoxEvents" Width="400"></asp:ListBox>
                    </div>
                    </div>
        </ContentTemplate>
        </asp:UpdatePanel>
       
        </form>
    </body>
    </html>

     
     
     
     
     

  •  03-19-2010, 4:34 AM 59510 in reply to 59507

    Re: File browsing dialog has been blocked

    Hi
     
    Because for Flash/Silverlight component, they do not allow api call to open the dialog.
     
    So when you use button.click() function , it will be block and show warning to let user click the Flash/Silverlight  again.
     
    If you just want to hide the queue table, you can declare this function:
     
    <script>
    function CuteWebUI_AjaxUploader_OnQueueUI(list)
    {
        return false;
    }
    </script>
     
  •  03-22-2010, 6:38 AM 59549 in reply to 59510

    Re: File browsing dialog has been blocked

    Hi,
     
    Thx for help, and is there any chance to fix this problem without hiding the queue table or turn off flash10  like I did it so far (when I turn off flash I can only add one file at once) .
  •  03-22-2010, 10:20 AM 59562 in reply to 59549

    Re: File browsing dialog has been blocked

    cesbart:
    Hi,
     
    Thx for help, and is there any chance to fix this problem without hiding the queue table or turn off flash10  like I did it so far (when I turn off flash I can only add one file at once) .
     
    cesbart,
     
    This issue is caused by sliverlight and flash security requirements. We can not fix it.

    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

View as RSS news feed in XML