Upload and master pages

Thread is closed for posting
7 posts, 0 answers
  1. Ed
    Ed avatar
    5 posts
    Member since:
    Oct 2008

    Posted 13 Nov 2008 Link to this post

    I'm going out of my mind. I have been trying all day to get the upload control to work following the getting started section in the help.
    I am not doing anything special at this point other than trying to get it to work. Below is my aspx, followed by the .vb, followed by my master page. I stripped out all the crud so that only the bare minimum is shown. I added the lines I was supposed to to the web.config.
    No matter what I do, RadUpload1.UploadedFiles.Count is always 0.
    Any help would be greatly appreciated!
    Thanks ... Ed


    <%

    @ Page Title="" Language="VB" MasterPageFile="~/MasterPages/Default.master" AutoEventWireup="false" CodeFile="UploadActuals.aspx.vb" Inherits="Admin_UploadActuals" %>

     

     

     <%

    @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

     

     

     

    <asp:Content ID="Content1" ContentPlaceHolderID="cntPageBody" Runat="Server">

     

     

     

    <telerik:RadProgressManager ID="RadProgressManager1" runat="server" />

     

     

     

    <telerik:RadUpload ID="RadUpload1" runat="server"  ControlObjectsVisibility="None" Skin="Vista" MaxFileInputsCount="1"

     

     

     

    TargetFolder="~/Uploads" InputSize="85" OverwriteExistingFiles="True"

     

     

     

    MaxFileSize="1000000" Width="396px" AllowedFileExtensions=".xls,.XLS">

     

     

     

    </telerik:RadUpload>

     

     

     

     <hr />

     

     

     

     <asp:ImageButton ID="cmdUpload" runat="server"  ImageUrl="~/Images/buttonSubmit.gif" />

     

     

     

    <telerik:RadProgressArea ID="RadProgressArea1" runat="server"  DisplayCancelButton="True"  

     

     

     

    ProgressIndicators="TotalProgressBar, TotalProgress, RequestSize, FilesCount, FilesCountPercent, SelectedFilesCount, CurrentFileName, TimeElapsed, TimeEstimated, TransferSpeed" Skin="Vista">

     

     <

    Localization Uploaded="Uploaded"></Localization>

     

     

     

    </telerik:RadProgressArea>

     

     

    </asp:Content>

    <%
    @ Page Title="" Language="VB" MasterPageFile="~/MasterPages/Default.master" AutoEventWireup="false" CodeFile="UploadActuals.aspx.vb" Inherits="Admin_UploadActuals" %>

     

     

     

     

    <%

    @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

     

     

    <asp:Content ID="Content1" ContentPlaceHolderID="cntPageBody" Runat="Server">

     

     

    <telerik:RadProgressManager ID="RadProgressManager1" runat="server" />

     

     

    <telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="None" Skin="Vista" MaxFileInputsCount="1"

     

     

    TargetFolder="~/Uploads" InputSize="85" OverwriteExistingFiles="True"

     

     

    MaxFileSize="1000000" Width="396px" AllowedFileExtensions=".xls,.XLS">

     

     

    </telerik:RadUpload>

     

     

    <hr />

     

     

    <asp:ImageButton ID="cmdUpload" runat="server"  ImageUrl="~/Images/buttonSubmit.gif" />

     

     

    <telerik:RadProgressArea ID="RadProgressArea1" runat="server" DisplayCancelButton="True"

     

     

    ProgressIndicators="TotalProgressBar, TotalProgress, RequestSize, FilesCount, FilesCountPercent, SelectedFilesCount, CurrentFileName, TimeElapsed, TimeEstimated, TransferSpeed" Skin="Vista">

     

     <

    Localization Uploaded="Uploaded"></Localization>

     

     

    </telerik:RadProgressArea>

     

     

    </asp:Content>

     

     

     

    <%

    @ Master Language="VB" CodeFile="Default.master.vb" Inherits="MasterPages_Default" %>

     

     <%

    @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

     

     

    <!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 id="Head1" runat="server">

     

     <

    title>LLCFin</title>

     

     </

    head>

     

     <

    body>

     

     

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

     

     

    <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True">

     

     

    </telerik:RadScriptManager>

     

     

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

     

     

    </telerik:RadAjaxManager>

     

     

    <telerik:RadSplitter ID="RadSplitter1" runat="server" LiveResize="True" Skin="Web20" Width="100%" Height="500px">

     

     

    <telerik:RadPane ID="RadPane1" Runat="server" Height="" Width="210px">

     

     

    <telerik:RadTreeView ID="MainMenu" runat="server" Skin="WebBlue">

     

     

    <CollapseAnimation Type="OutQuint" Duration="100">

     

     <

    /CollapseAnimation>

     

     

    <ExpandAnimation Duration="100">

     

     

    </ExpandAnimation>

     

     

    </telerik:RadTreeView>

     

     

    </telerik:RadPane>

     

     

     

     

    <telerik:RadSplitBar ID="RadSplitBar1" Runat="server" CollapseMode="Forward" />

     

     

     

    <telerik:RadPane ID="RadPane2" Runat="server">

     

     

     

    <asp:ContentPlaceHolder ID="cntPageBody" runat="server">

     

     

     

    </asp:ContentPlaceHolder>

     

     

     

    </telerik:RadPane>

     

     

     

    </telerik:RadSplitter>

     

     

     

    </form>

     </

    body>

     

     </

    html>

     

     

     

     

     

     

  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 14 Nov 2008 Link to this post

    Hi Ed,

    Are you using IIS7? There are some specific settings to be added in the web.config for IIS7. I hope you followed all the articles in the RadUpload / Configuration section in the help.

    Sincerely yours,
    Veselin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Ed Staffin
    Ed Staffin avatar
    66 posts
    Member since:
    Nov 2008

    Posted 14 Nov 2008 Link to this post

    Nope, no IIS7, I'm on a windows server 2003.
    I opened a support ticket with a stripped down version of what I am doing that hopefully should help you guys to help me.
    Stay tuned!
    Thanks ... Ed
  4. Chad
    Chad avatar
    3 posts
    Member since:
    Sep 2008

    Posted 29 Jan 2009 Link to this post

    If your upload control is in an update panel or wrapped in a AJAX wrapper, AJAX prevents the upload control from working. See this link..
    RadControl with AJAX
  5. P
    P avatar
    2 posts
    Member since:
    Feb 2009

    Posted 27 Jul 2009 Link to this post

    I have to ask, WTF's the point of calling these controls AJAX controls if "some" of them aren't able to work with AJAX?

    I'm just frustrated cause like the original poster, I too have been working on this all day and floating back'n'forth from one control to another only to read that this stuff don't frigg'n work with AJAX (without bending over backwards)!  Very VERY disappointing.  We didn't get Telerik to rewrite things from scratch.
  6. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 28 Jul 2009 Link to this post

    Hi guys,

    @P: I am sorry for your frustration.

    We clearly stated that RadUpload relies on the standard <input type="file"> element and outlined the current limitations of the control.

    To overcome these limitations we created a demo which uses RadUpload for Silverlight in ASP.NET Ajax project. Please check it here.

    Greetings,
    Veselin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. gustavo poveda
    gustavo  poveda avatar
    1 posts
    Member since:
    Sep 2009

    Posted 07 Sep 2009 Link to this post

    same problem here... how do i make it work! tried every sample ive found, any ideas for radgrid and radupload

    if (e.CommandName == RadGrid.UpdateCommandName)
                {
                    if (id == -1)
                    {
                        if (!string.IsNullOrEmpty(this.hiddenAccountID.Value))
                        {
                            int idAccount = int.Parse(this.hiddenAccountID.Value);
                            RadUpload uploader = e.Item.FindControl("RadUpload1") as RadUpload;
                            TextBox DescriptionTxt = e.Item.FindControl("txtDescription") as TextBox;
                            TextBox FileNameTxt = e.Item.FindControl("txtFileName") as TextBox;

                            UploadedFile Ufile = null;

                            if (uploader.UploadedFiles.Count > 0) ------> always comes as zero.
                            {
                                Ufile = uploader.UploadedFiles[0];
                                //saving method goes here

                                System.IO.Stream stream = Ufile.InputStream;
                                Byte[] data = new byte[stream.Length];

                                int len = (int)stream.Length;
                                stream.Read(data, 0, len);
                                stream.Close();

                                AccountDocument ad = new AccountDocument();
                                ad.AccountDocumentID = id;
                                ad.AccountID = idAccount;
                                ad.FileName = Ufile.FileName + "." + Ufile.GetExtension();
                                ad.Description = DescriptionTxt.Text;
                                ad.Content = data;
                                if (id == -1)
                                {
                                    ad.CreateDate = DateTime.Now;
                                    ad.CreatedByUserID = loggedUser;
                                }

                                AccountBO.SaveAccountDocument(ad);



            <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanelgrdAccountDocs" ClientEvents-OnRequestStart="conditionalPostback">
            
                <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
                    <script type="text/javascript">
                        // <![CDATA[
                        //On insert and update buttons click temporarily disables ajax to perform upload actions
                        function conditionalPostback(sender, eventArgs) {
                            if (eventArgs.get_eventTarget() == $find('btnUpdateDocument.ClientID')) {
                                
                                var Upload = $find('RadUpload1.ClientID')
                                // proceed with the validation

                                //var upload = $find(window['UploadId']);

                                //AJAX is disabled only if file is selected for upload
                                if (Upload.getFileInputs()[0].value != "") {
                                    eventArgs.set_enableAjax(false);
                                }
                            }
                        }

                        // ]]>
                    </script>
                </telerik:RadCodeBlock>
            
                <%--<telerik:RadProgressManager ID="RadProgressManager1" runat="server" />
            <telerik:RadProgressArea ID="RadProgressArea1" runat="server" />--%>
                
                <telerik:RadGrid ID="grdAccountDocs"
                    runat="server"             
                    AllowPaging="True"
                    AllowSorting="True"            
                    AutoGenerateColumns="False"                    
                    EnableEmbeddedSkins="false"
                    OnNeedDataSource="grdAccountDocs_NeedDataSource"
                    OnItemCommand="grdAccountDocs_OnItemCommand"
                    OnItemDataBound="grdAccountDocs_OnItemDataBound"                                        
                    PageSize="100"
                    Width="100%"
                    Height="450px"
                    Skin="Vista">
                    <PagerStyle Mode="NextPrev"></PagerStyle>
                
                    <MasterTableView
                        AutoGenerateColumns="False"
                        CommandItemDisplay="Top"
                        DataKeyNames="AccountDocumentID"
                        Width="100%">
                        <Columns>                                                    
                            <telerik:GridBoundColumn
                                DataField="FileName"
                                HeaderText="File Name"
                                UniqueName="FileName"
                                Visible="true">
                                <HeaderStyle Width="15%" />                   
                            </telerik:GridBoundColumn>
                            
                             
                            
                            <telerik:GridBoundColumn
                                DataField="Description"
                                HeaderText="Description"
                                UniqueName="Description"
                                Visible="true">
                                <HeaderStyle Width="15%" />
                            </telerik:GridBoundColumn>
                            
                            <telerik:GridBoundColumn
                                DataField="CreateDate"
                                HeaderText="Upload Date"
                                UniqueName="CreateDate"
                                Visible="true">
                                <HeaderStyle Width="15%" />
                            </telerik:GridBoundColumn>
                            
                             <telerik:GridBoundColumn
                                DataField="CreatedByUserName"
                                HeaderText="Uploaded By User"
                                UniqueName="CreatedByUserName"                             
                                Visible="true">
                                <HeaderStyle Width="15%" />
                            </telerik:GridBoundColumn>
                            
                            <telerik:GridButtonColumn
                                ButtonType="ImageButton"
                                ImageUrl="../../css/Vista/Grid/Delete.gif"                         
                                CommandName="Delete"
                                ConfirmText="Are you sure you want to Delete this Document?"
                                HeaderText="Delete"
                                UniqueName="DeleteColumn">
                                <HeaderStyle HorizontalAlign="Center" Width="5%" />
                                <ItemStyle HorizontalAlign="Center" />
                            </telerik:GridButtonColumn>
                            
                        </Columns>
                        <EditFormSettings EditFormType="Template">
                            <FormTemplate>
                                <table width="50%" class="editTable">
                                    <tr>
                                        <td>
                                            File Name<br />
                                            <asp:TextBox runat="server" ID="txtFileName" Width="150px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Description<br />
                                            <asp:TextBox runat="server" ID="txtDescription" Width="150px"></asp:TextBox>
                                        </td>
                                    </tr>
                                     <tr>
                                        <td colspan="3">
                                            Select Upload File<br />
                                             <telerik:RadUpload
                                                ID="RadUpload1"
                                                runat="server"
                                                Width="300px"
                                                InitialFileInputsCount="1"
                                                MaxFileInputsCount="1"
                                                ControlObjectsVisibility="None"
                                                MaxFileSize="1000000"
                                                AllowedFileExtensions="*.*" />                                        
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" align="left">
                                             <asp:ImageButton
                                                ID="btnUpdateDocument"
                                                ImageUrl="~/Images/Buttons/button-submit.png"
                                                runat="server"
                                                CommandName="Update"
                                                ValidationGroup="ListGroup">
                                            </asp:ImageButton>
                                                                
                                            <asp:ImageButton
                                                ID="btnCancel1"
                                                ImageUrl="~/Images/Buttons/button-cancel.png"
                                                runat="server"
                                                CausesValidation="False"
                                                CommandName="Cancel"
                                                ValidationGroup="ListGroup">
                                            </asp:ImageButton>
                                        </td>
                                    </tr>
                                </table>
                            </FormTemplate>                    
                        </EditFormSettings>
                    </MasterTableView>
                    <ClientSettings>
                        <Scrolling AllowScroll="True"></Scrolling>
                    </ClientSettings>
                    <FilterMenu EnableEmbeddedSkins="False">
                    </FilterMenu>
                </telerik:RadGrid>     
                </telerik:RadAjaxPanel>                              
            </telerik:RadPageView>


Back to Top