Re: Can we change Position for "Upload Multiple Files" Button Postion?

  •  02-12-2009, 4:15 AM

    Re: Can we change Position for "Upload Multiple Files" Button Postion?

    I am using master page and content page is having upload control.
    This is the aspx code

    <
    asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderUI" runat="Server">

    <asp:ScriptManagerProxy ID="Scriptmanager1" runat="server">

    </asp:ScriptManagerProxy>

    <table align="center" border="0" cellpadding="5" cellspacing="0" class="TableBgColor"

    style="height: 100%">

    <tr>

    <td align="center" valign="top">

    <table border="0" align="center" cellpadding="5" cellspacing="0" style="width: 766px"

    class="TableBgColor">

    <tr>

    <td colspan="2" align="center" class="lblHeading">

    Upload Files

    </td>

    </tr>

    <tr>

    <td align="left" colspan="2" style="height: 5px">

    </td>

    </tr>

    <tr>

    <td align="right" valign="top" class="subheading">

    </td>

    <td align="left" colspan="2" style="height: 5px">

    <asp:UpdatePanel ID="UpdatePanel4" runat="server">

    <ContentTemplate>

    <asp:Label ID="lblError" runat="server" CssClass="lblValidation" Text=""></asp:Label>

    </ContentTemplate>

    </asp:UpdatePanel>

    </td>

    </tr>

    <tr>

    <td align="right" valign="middle" class="style3">

    Subject:

    </td>

    <td align="left" valign="middle">

    <asp:UpdatePanel ID="UpdatePanel6" runat="server">

    <ContentTemplate>

    <cc1:ListSearchExtender ID="ListSearchExtenderTitle" TargetControlID="drpTitle" PromptText=""

    QueryPattern="StartsWith" QueryTimeout="2000" runat="server">

    </cc1:ListSearchExtender>

    <asp:DropDownList ID="drpTitle" runat="server" CssClass="styledrpntext" Width="450px"

    OnSelectedIndexChanged="drpTitle_SelectedIndexChanged" AutoPostBack="True">

    </asp:DropDownList>

    </ContentTemplate>

    </asp:UpdatePanel>

    <asp:RequiredFieldValidator ID="rfvTitle" runat="server" InitialValue="0" ControlToValidate="drpTitle"

    Display="Dynamic" SetFocusOnError="True" ErrorMessage="please select a subject">

    </asp:RequiredFieldValidator>

    </td>

    </tr>

    <tr>

    <td align="right" valign="middle" class="style3">

    Project:

    </td>

    <td align="left" valign="middle">

    <asp:UpdatePanel ID="UpdatePanel7" runat="server">

    <ContentTemplate>

    <cc1:ListSearchExtender ID="ListSearchExtenderProjectType" TargetControlID="drpProjectType"

    QueryPattern="StartsWith" QueryTimeout="2000" PromptText="" runat="server">

    </cc1:ListSearchExtender>

    <asp:DropDownList ID="drpProjectType" runat="server" CssClass="styledrpntext" Width="450px"

    TabIndex="1" OnSelectedIndexChanged="drpProjectType_SelectedIndexChanged" AutoPostBack="True">

    </asp:DropDownList>

    </ContentTemplate>

    </asp:UpdatePanel>

    <asp:RequiredFieldValidator ID="rfvproject" runat="server" InitialValue="0" ControlToValidate="drpProjectType"

    Display="Dynamic" SetFocusOnError="True" ErrorMessage="please select a project">

    </asp:RequiredFieldValidator>

    </td>

    </tr>

    <tr>

    <td align="right" valign="middle" class="style3">

    Upload File 1 (zip):

    </td>

    <td align="left" valign="top">

    <div style="width: 550px;">

    <table cellpadding="0" cellspacing="0">

    <tr>

    <td class="style1">

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">

    <ContentTemplate>

    <table cellpadding="0" cellspacing="0">

    <tr>

    <td>

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

    InsertButtonID='BrowseButton1' MaxFilesLimit="1"

    MultipleFilesUpload="False" NumFilesShowCancelAll="1" ShowTableHeader="False"

    CancelButtonID="CancelButton1">

    <ValidateOption MaxSizeKB="2097150" AllowedFileExtensions="zip" />

    <ProgressLabelStyle CssClass="textgraysnd" />

    </CuteWebUI:UploadAttachments>

    <asp:ImageButton runat="server" ID="CancelButton1" ImageUrl="~/Images/cancel_btn.jpg"

    CausesValidation="false" ImageAlign="Top" AlternateText="Cancel" />

    </td>

    </tr>

    <tr>

    <td>

    <input id="txtfile1" type="text" />&nbsp;

    <asp:ImageButton runat="server" ID="BrowseButton1" OnClientClick="return browsebutton_click(1)"

    ImageUrl="~/Images/browse_btn.jpg" CausesValidation="true" ImageAlign="Top" />&nbsp;

    <asp:ImageButton runat="server" ID="SubmitButton1" OnClientClick="return submitbutton_click(1)"

    ImageUrl="~/Images/upload_btn.jpg" CausesValidation="true" ImageAlign="Top" />

    </td>

    </tr>

    <tr>

    <td>

    <asp:Label ID="lblSiteZip" runat="server" Text=""></asp:Label>

    </td>

    </tr>

    </table>

    </ContentTemplate>

    </asp:UpdatePanel>

    </td>

    </tr>

    </table>

    </div>

    </td>

    </tr>

    <tr>

    <td align="right" valign="middle" class="style3">

    Upload File 2 (zip):

    </td>

    <td align="left" valign="top">

    <div style="width: 550px;">

    <table cellpadding="0" cellspacing="0">

    <tr>

    <td class="style1">

    <asp:UpdatePanel ID="UpdatePanel2" runat="server">

    <ContentTemplate>

    <table cellpadding="0" cellspacing="0">

    <tr>

    <td>

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

    InsertButtonID='BrowseButton2' MaxFilesLimit="1"

    MultipleFilesUpload="False" NumFilesShowCancelAll="1" ShowTableHeader="False"

    CancelButtonID="CancelButton2">

    <ValidateOption MaxSizeKB="2097150" AllowedFileExtensions="zip" />

    <ProgressLabelStyle CssClass="textgraysnd" />

    </CuteWebUI:UploadAttachments>

    <asp:ImageButton runat="server" ID="CancelButton2" ImageUrl="~/Images/cancel_btn.jpg"

    CausesValidation="false" ImageAlign="Top" AlternateText="Cancel" />

    </td>

    </tr>

    <tr>

    <td>

    <input id="txtfile2" type="text" />&nbsp;

    <asp:ImageButton runat="server" ID="BrowseButton2" OnClientClick="return browsebutton_click(2)"

    ImageUrl="~/Images/browse_btn.jpg" CausesValidation="true" ImageAlign="Top" />&nbsp;

    <asp:ImageButton runat="server" ID="SubmitButton2" OnClientClick="return submitbutton_click(2)"

    ImageUrl="~/Images/upload_btn.jpg" CausesValidation="true" ImageAlign="Top" />

    </td>

    </tr>

    <tr>

    <td>

    <asp:Label ID="lblAssetZip" runat="server" Text=""></asp:Label>

    </td>

    </tr>

    </table>

    </ContentTemplate>

    </asp:UpdatePanel>

    </td>

    </tr>

    </table>

    </div>

    </td>

    </tr>

    <tr>

    <td>

    </td>

    <td colspan="1" align="left">

    <table width="450px">

    <tr>

    <td align="center">

    <asp:UpdatePanel ID="UpdatePanel5" runat="server">

    <ContentTemplate>

    <asp:ImageButton ID="btn_Submit" runat="server" ImageUrl="~/Images/submit_btn.jpg"

    OnClick="btn_Submit_Click" TabIndex="5" />

    &nbsp;&nbsp;

    <asp:ImageButton ID="btnCancel" runat="server" CausesValidation="false" OnClick="btnCancel_Click"

    TabIndex="6" ImageUrl="~/Images/cancel_btn.jpg" />

    </ContentTemplate>

    </asp:UpdatePanel>

    </td>

    </tr>

    </table>

    </td>

    </tr>

    <tr>

    <td align="left" colspan="2" style="height: 5px">

    </td>

    </tr>

    </table>

    </td>

    </tr>

    </table>

    <script type="text/javascript">

     

    var textboxnbr;

     

    function browsebutton_click(nbr)

    {

    textboxnbr = nbr;

     

    var etitle = document.getElementById('<%=drpTitle.ClientID %>').value;

    var eproject = document.getElementById('<%=drpProjectType.ClientID %>').value;

     

    if (etitle==0)

    {

    document.getElementById('<%=rfvTitle.ClientID %>').style.display="inline";

    }

    else if (eproject==0)

    {

    document.getElementById('<%=rfvproject.ClientID %>').style.display="inline";

    }

    else

    {

    document.getElementById('<%=rfvTitle.ClientID %>').style.display="none";

    document.getElementById('<%=rfvproject.ClientID %>').style.display="none";

    return true;

    }

     

    return false;

    }

     

    //called when files be selected..

    function CuteWebUI_AjaxUploader_OnQueueUI(list)

    {

    try

    {

    var filename = list[0].FileName;

     

    if (textboxnbr == 1)

    {

    document.forms[0].txtfile1.value = filename;

    }

    else

    if (textboxnbr == 2)

    {

    document.forms[0].txtfile2.value = filename;

    }

     

    return false;

    }

    catch(Error)

    {

    return false;

    }

    }

     

    function CuteWebUI_AjaxUploader_OnStop()

    {

    try

    {

    document.getElementById('<%=lblError.ClientID %>').innerHTML="";

     

    if (textboxnbr == 1)

    {

    document.forms[0].txtfile1.value = "";

    document.getElementById('<%=SubmitButton2.ClientID %>').disabled=false;

    }

    else if (textboxnbr == 2)

    {

    document.forms[0].txtfile2.value = "";

    document.getElementById('<%=SubmitButton1.ClientID %>').disabled=false;

    }

    textboxnbr = 0;

    return false;

    }

    catch(Error)

    {

    return false;

    }

    }

    function submitbutton_click(nbr)

    {

    try

    {

     

    if (nbr == 1)

    {

    var submitbutton = document.getElementById('<%=SubmitButton1.ClientID %>');

    var uploadobj = document.getElementById('<%=Uploader1.ClientID %>');

    document.getElementById('<%=SubmitButton2.ClientID %>').disabled=true;

    }

    else

    if (nbr == 2)

    {

    var submitbutton = document.getElementById('<%=SubmitButton2.ClientID %>');

    var uploadobj = document.getElementById('<%=Uploader2.ClientID %>');

    document.getElementById('<%=SubmitButton1.ClientID %>').disabled=true;

    }

     

    if(!window.filesuploaded)

    {

    if(uploadobj.getqueuecount()>0)

    {

    document.getElementById('<%=lblError.ClientID %>').innerHTML="File upload in progress...";

    uploadobj.startupload();

    }

    else

    {

    alert("Please select a file and then click Upload button");

    var uploadedcount=parseInt(submitbutton1.getAttribute("itemcount"))||0;

    if(uploadedcount>0)

    {

    return true;

    }

    //alert("Please browse files for upload");

    }

    return false;

    }

    window.filesuploaded=false;

    return true;

    }

    catch(Error){}

    }

     

    </script>

    </asp:Content>
     
     
    and .cs code is
     

    protected override void OnInit(EventArgs e)

    {

    base.OnInit(e);

    Uploader1.FileUploaded += new UploaderEventHandler(Uploader1_FileUploaded);

    Uploader2.FileUploaded += new UploaderEventHandler(Uploader2_FileUploaded);

    }

    protected override void OnPreRender(EventArgs e)

    {

    base.OnPreRender(e);

    Uploader1.GetItemsTable().Visible = false;

    Uploader2.GetItemsTable().Visible = false;

    }
     
    Please help
     
    Regards,
    yogesh
View Complete Thread