Possible File Explorer BUg

5 posts, 0 answers
  1. Jim
    Jim avatar
    42 posts
    Member since:
    Mar 2009

    Posted 25 Feb 2010 Link to this post

    I made two small modifications to the default File Explorer Demo to test a problem I am having, and I was able to repeat the problem on it.
    The issue is this:
    I added a button to a page and a PreRender event to the file Explorer control on a page with the intention of updating the button text after the prerender event occurs on the file explorer. For some reason, if I upload a new file, the button text is updated as it should be, if I delete an existing file, the pre render event occurs, and the code to change the button text runs, but the text on the button is never updated. Why would I get this result?
    /radcontrols_aspnetajax/fileexplorer/examples/default/defaultcs.aspx
    take your existing file explorer default demo, and add a button above the text: "Browse to an image and double click to preview."

    <asp:Button ID="btnSubmit" runat="server" Text="Submit" /> 
     
    then add a PreRender to FileExplorer1:
            protected void FileExplorer1_PreRender(object sender, EventArgs e)  
            {  
                btnSubmit.Text += " | 1";  
            } 
    If you put a break point on the text change, it will fire both on adding a new document and deleting an existing document, but the button text does not change on delete.

    Is this a bug?
    If not, how do I change the other controls on a page after an FileExplorer event?
  2. Jim
    Jim avatar
    42 posts
    Member since:
    Mar 2009

    Posted 01 Mar 2010 Link to this post

    Hey Telerik, what is going on with the response time? You guys used to post replies within 24 hours. I posted this question a week ago, and you still have not responded? Can you please advise on this bug?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 02 Mar 2010 Link to this post

    Hello Jim,

    The behavior you experienced is not a bug - this is the way we expect the control to function. When you upload a file with the RadFileExplorer, a normal postback occurs and all controls on the page are recreated and updated in the browser. In this case you see that the button text is updated. On the other hand, all the rest of the RadFileExplorer operations make AJAX requests. During that request, all controls are recreated on the server again, but only the file explorer controls are updated in the browser, since this is a partial page postback. Changes you make to other controls (e.g. the button) will not be reflected on the page, because the button is not inside an ASP.NET AJAX UpdatePanel control. If you want the button to be updated during AJAX requests, you need to put it in an UpdatePanel control with its UpdateMode set to Always.

    Greetings,
    Lini
    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.
  5. Jim
    Jim avatar
    42 posts
    Member since:
    Mar 2009

    Posted 02 Mar 2010 Link to this post

    OK,
    I added an ajax settings section to address the issue, and this fixes the delete problem, but it has created a new problem. Now, the document upload doesn't work. I need a client-side event to disable ajax when files are uploaded, but I don't see one for the File Explorer. How would I go about disabling ajax when a file is being uploaded?

    Well, I switched from this:
                                    <telerik:RadAjaxManager ID="ramManager" runat="server">  
                                        <AjaxSettings> 
                                            <telerik:AjaxSetting AjaxControlID="FileExplorer1">  
                                                <UpdatedControls> 
                                                    <telerik:AjaxUpdatedControl ControlID="lblItemStatus" /> 
                                                    <telerik:AjaxUpdatedControl ControlID="rntbRequestedAmount" /> 
                                                    <telerik:AjaxUpdatedControl ControlID="lblMaxAmount" /> 
                                                    <telerik:AjaxUpdatedControl ControlID="ddlIsPoComplete" /> 
                                                    <telerik:AjaxUpdatedControl ControlID="btnSubmit" /> 
                                                </UpdatedControls> 
                                            </telerik:AjaxSetting> 
                                        </AjaxSettings> 
                                    </telerik:RadAjaxManager> 
     
    to a standard Update panel with the update mode set to always, and that seems to work.
    <asp:UpdatePanel ID="upPoItems" runat="server" UpdateMode="Always"
  6. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 05 Mar 2010 Link to this post

    Hi Jim,

    I have attached an example that shows how to update a button by the UpdatePanel embedded inside the RadFileExplorer control. Also, I added a handler to the OnItemCommand event of the RadFileExplorer control. The button's text is changed inside that handler.

    I hope this helps.

    All the best,
    Fiko
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017