How do one position file list

Last post 03-01-2012, 6:17 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  02-29-2012, 10:57 AM 73263

    How do one position file list


    I am currently using ajax uploader on website i am in the progress of building.   I am using a custom browse for file / upload button which was easy to place.   I also centered the upload progress bar in the middle of my div.  However, the file list is not centered in my div.. How do, i center the file list?
     
    The Progress Bar
     
    The File List
     
     
    The Source Code
    1. <div style="float:left; margin:0px 0px 0px 0px; border:thin solid transparent; width:675px;" >     
    2.                    <p style="text-align:center; margin:0px;" >Select an image file on your computer (4MB max): </p>  
    3.                    <p style="text-align:center; margin:0px;" >  
    4.                        <asp:Image ImageUrl="~/Images/selectanimage.png"  runat="server" ID="Image1"  style="margin:10px auto 0px auto;" />  
    5.                    </p>  
    6.                       
    7.                    <div style="text-align:center; margin:0px auto 0px auto; width:400px; border:thin solid transparent; " >  
    8.                        <CuteWebUI:Uploader   ID="FileUploader1" ClientIDMode="Static" ProgressLabelStyle-CssClass="DialogLabel"  MaxFilesLimit="1" runat="server"  TempDirectory="~/UploaderTemp"    
    9.                         OnUploadCompleted="Uploader1_UploadCompleted" InsertButtonID="Image1" >  
    10.                        <ValidateOption AllowedFileExtensions=".png,.jpg,.bmp,.jpeg,.gif, ," />                    
    11.                        </CuteWebUI:Uploader  >  
    12.                        <asp:Button runat="server" ID="SubmitButton" OnClientClick="return submitbutton_click()" Text="Submit" style="display:none;"  />  
    13.                        <div style="clear:both;" ></div>  
    14.                    </div>  
    15.                     
    16.                    <asp:Panel ID="ImagePanel" ClientIDMode="Static" runat="server"   style="margin:10px auto 0px auto; padding:0px; border:thin solid transparent;  width:675px;" >      
    17.                        <p style="margin:10px 0px 0px 0px; text-align:center;" class="DialogLabel" >Crop the image area you wish to use as your button</p>    
    18.                           
    19.                        <p style="text-align:center; margin:0px;" >    
    20.                            <asp:Panel ID="ImageDiv"        ClientIDMode="Static" runat="server"  style="clear:both; margin:0px 0px 0px 0px;   border:thin solid black; background-image:url(../Images/workarea.png); " >             
    21.                            <asp:Image ID="resizebleImage"  ClientIDMode="Static" runat="server"  style="clear:both; margin:8px 0px 0px 10px;  border:thin solid red;"   />       
    22.                            </asp:Panel>     
    23.                        </p>  
    24.                    </asp:Panel>  
    25.                     
    26.              </div>  
  •  03-01-2012, 6:17 AM 73270 in reply to 73263

    Re: How do one position file list

    Hi ScottDolan,
     
    You can custom the attachment table to achieve your own style setting of it.
     
    <%@ Page Language="C#" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
        protected void Attachments1_PreRender(object sender, EventArgs e)
        {
            Attachments1.GetItemsTable().Visible = false;
            DataList1.DataSource = Attachments1.Items;
            DataList1.DataBind();
        }
        protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
        {
            Attachments1.Items[e.Item.ItemIndex].Remove();
        }
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <CuteWebUI:UploadAttachments InsertText="Upload Multiple files Now" runat="server"
                    OnPreRender="Attachments1_PreRender" ID="Attachments1">
                </CuteWebUI:UploadAttachments>
                <asp:DataList ID="DataList1" runat="server" OnItemCommand="DataList1_ItemCommand" style="margin-left:500px">
                    <ItemTemplate>
                        <table cellpadding="0" cellspacing="0" border="0" style="border-top: solid 1px #ededed;
                            border-bottom: solid 1px #ededed;">
                            <tr>
                                <td style="border-left: solid 1px #ededed; width: 40px">
                                    <img src="CuteWebUI_Uploader_Resource.axd?type=file&file=circle.png&_ver=634009764514705972" /></td>
                                <td style="border-left: solid 1px #ededed; width: 300px">
                                    <%# Eval("FileName") %>
                                    (
                                    <%# Eval("FileSize") %>
                                    Byte )
                                </td>
                                <td style="border-left: solid 1px #ededed; border-right: solid 1px #ededed; width: 50px">
                                    <asp:LinkButton ID="remove" runat="server">remove</asp:LinkButton></td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:DataList>
            </div>
        </form>
    </body>
    </html>
     
    Regards,
     
    Ken 
View as RSS news feed in XML