Browse button stop working suddenly!

Last post 12-13-2008, 10:03 AM by cutechat. 5 replies.
Sort Posts: Previous Next
  •  12-04-2008, 7:33 AM 46553

    Browse button stop working suddenly!

    Hi, I have installed your component with our project, for the first time it works perfectly but suddenly the browse button stop showing the files dialog without displaying any error message(In FireFox the browse button has been disabled).
    Any suggesstion please?
  •  12-04-2008, 9:25 AM 46560 in reply to 46553

    Re: Browse button stop working suddenly!

    Do you have problems with this example?
     
    Selecting multiple files for upload
    Ajax Uploader 2.0 allows you to select multiple files and upload multiple files at once.
     
    If not, please download the latet build and try again.

    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

  •  12-05-2008, 4:18 PM 46627 in reply to 46560

    Re: Browse button stop working suddenly!

    The version that I have is 2.0.20081118
     
    Here is my code:

    <CuteWebUI:UploadAttachments runat="server" ManualStartUpload="true" ID="Uploader1"

    InsertText="Browse Files (Max 1M)" >

    <VALIDATEOPTION MaxSizeKB="1024" />

    </CuteWebUI:UploadAttachments>

    <br />

    <br />

    <asp:Button runat="server" ID="SubmitButton" OnClick="SubmitButton_Click" OnClientClick="return submitbutton_click()" Text="Submit" />

    <br />

    <br />

    <div>

    <asp:ListBox runat="server" ID="ListBoxEvents" Width="400"></asp:ListBox>

    </div>

    <br />

    <br />

    <asp:Button ID="ButtonPostBack" Text="This is a PostBack button" runat="server" />

     

    Protected Sub InsertMsg(ByVal msg As String)

    ListBoxEvents.Items.Insert(0, msg)

    ListBoxEvents.SelectedIndex = 0

    End Sub

     

     

    Protected Sub ButtonPostBack_Click(ByVal sender As Object, ByVal e As EventArgs)

    InsertMsg("You clicked a PostBack Button.")

    End Sub

    Protected Sub SubmitButton_Click(ByVal sender As Object, ByVal e As EventArgs)

    InsertMsg("You clicked the Submit Button.")

    InsertMsg("You have uploaded " & uploadcount & "/" & Uploader1.Items.Count & " files.")

    End Sub

     

    Protected Sub Uploader_FileUploaded(ByVal sender As Object, ByVal args As UploaderEventArgs)

    uploadcount += 1

    Dim uploader As CuteWebUI.Uploader = DirectCast(sender, CuteWebUI.Uploader)

    InsertMsg("File uploaded! " & args.FileName & ", " & args.FileSize & " bytes.")

    'Copys the uploaded file to a new location.

    args.CopyTo(Session("CurrentPath").ToString)

    End Sub

    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender

    SubmitButton.Attributes("itemcount") = Uploader1.Items.Count.ToString()

    lblUploadPath.Text = Session("CurrentPath").ToString

    updpnlUpload.Update()

    End Sub

  •  12-06-2008, 9:24 AM 46634 in reply to 46627

    Re: Browse button stop working suddenly!

    Hi cassini,
     
    Please test this example:
     

    <%@ Page Language="VB" %>

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

    <script runat="server">
        Private Sub InsertMsg(ByVal msg As String)
            ListBoxEvents.Items.Insert(0, msg)
            ListBoxEvents.SelectedIndex = 0
        End Sub

        Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)
            MyBase.OnInit(e)
       
            AddHandler Uploader1.FileUploaded, AddressOf Uploader_FileUploaded
            AddHandler ButtonPostBack.Click, AddressOf ButtonPostBack_Click
        End Sub

        Private Sub ButtonPostBack_Click(ByVal sender As Object, ByVal e As EventArgs)
            InsertMsg("You clicked a PostBack Button.")
        End Sub

        Private Sub SubmitButton_Click(ByVal sender As Object, ByVal e As EventArgs)
            InsertMsg("You clicked the Submit Button.")
            InsertMsg(("You have uploaded " & uploadcount & "/") & Uploader1.Items.Count & " files.")
        End Sub

        Private uploadcount As Integer = 0

        Private Sub Uploader_FileUploaded(ByVal sender As Object, ByVal args As UploaderEventArgs)
            uploadcount += 1
       
            Dim uploader As Uploader = DirectCast(sender, Uploader)
            InsertMsg(("File uploaded! " & args.FileName & ", ") & args.FileSize & " bytes.")
        End Sub

        Protected Overloads Overrides Sub OnPreRender(ByVal e As EventArgs)
            SubmitButton.Attributes("itemcount") = Uploader1.Items.Count.ToString()
       
            MyBase.OnPreRender(e)
        End Sub


    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <h2>
                    Start uploading manually</h2>
                <p>
                    This sample demonstrates how to start uploading manually after file selection vs
                    automatically.</p>
                <CuteWebUI:UploadAttachments runat="server" ManualStartUpload="true" ID="Uploader1"
                    InsertText="Browse Files (Max 1M)">
                    <ValidateOption MaxSizeKB="1024" />
                </CuteWebUI:UploadAttachments>
                <br />
                <br />
                <asp:Button runat="server" ID="SubmitButton" OnClientClick="return submitbutton_click()"
                    Text="Submit" OnClick="SubmitButton_Click" />
                <br />
                <br />
                <div>
                    <asp:ListBox runat="server" ID="ListBoxEvents" Width="400"></asp:ListBox>
                </div>
                <br />
                <br />
                <asp:Button ID="ButtonPostBack" Text="This is a PostBack button" runat="server" />
            </div>
        </form>

        <script type="text/javascript">
     
     function submitbutton_click()
     {
      var submitbutton=document.getElementById('<%=SubmitButton.ClientID %>');
      var uploadobj=document.getElementById('<%=Uploader1.ClientID %>');
      if(!window.filesuploaded)
      {
       if(uploadobj.getqueuecount()>0)
       {
        uploadobj.startupload();
       }
       else
       {
        var uploadedcount=parseInt(submitbutton.getAttribute("itemcount"))||0;
        if(uploadedcount>0)
        {
         return true;
        }
        alert("Please browse files for upload");
       }
       return false;
      }
      window.filesuploaded=false;
      return true;
     }
     function CuteWebUI_AjaxUploader_OnPostback()
     {
      window.filesuploaded=true;
      var submitbutton=document.getElementById('<%=SubmitButton.ClientID %>');
      submitbutton.click();
      return false;
     }
        </script>

    </body>
    </html>

     
     
    Regards,
     
    Ken
  •  12-07-2008, 9:56 AM 46640 in reply to 46634

    Re: Browse button stop working suddenly!

    Hi, before I test your code I opend the one in our project and it works now without making any change!
    Any idea why this happened?!
  •  12-13-2008, 10:03 AM 46896 in reply to 46640

    Re: Browse button stop working suddenly!

    Hi,
     
    I am not sure what's wrong.
    Are you always use same PC and same browsers ? and then sometimes OK, sometimes not ?
     
    Regards,
    Terry
View as RSS news feed in XML