Click here to Skip to main content
15,917,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
File Upload COntrol is not working on first click(Uploading) but it working in second click(Uploading),Please help me to clear this issue
Posted
Updated 28-Dec-14 19:53pm
v2
Comments
KaushalJB 29-Dec-14 1:53am    
Update your question with the code that you have applied including your html part.
SathishRam 29-Dec-14 2:19am    
My Design part: <tr>
<td class="ControlCell" style="width: 90%">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<contenttemplate>
<asp:FileUpload ID="FileUpload_PO" runat="server" Width="93%" ChildrenAsTriggers="false"/>

<asp:Button ID="btnAsyncUpload" style="display:none" runat="server" Text="Async_Upload" OnClick="btnAsyncUpload_Click"/>
<asp:Button ID="btnUpload" style="display:none" runat="server" Text="Upload" OnClick ="btnUpload_Click"/>

<Triggers>
<asp:AsyncPostBackTrigger ControlID = "btnAsyncUpload" EventName = "Click" />
<asp:PostBackTrigger ControlID = "btnSubmit" />
</Triggers>

<asp:RequiredFieldValidator ID="RequiredFieldValidator33" runat="server" ControlToValidate="FileUpload_PO" ToolTip="Select a file" Display ="Dynamic" ValidationGroup ="VgFileUpload_PO" >
<asp:Image ID="Image40" runat="server" ImageUrl="~/Images/Error.png" Width="20px" />

<asp:RegularExpressionValidator ID="RegularExpression_FileUpload_PO" ControlToValidate="FileUpload_PO" runat="server" ToolTip="" ValidationGroup="VgFileUpload_PO" Display="Dynamic" ValidationExpression="<%$appSettings:ValidUploadPOExtensionRegExp %>">
<asp:Image ID="Image20" runat="server" ImageUrl="~/Images/Error.png" Width="20px" />

</td>
</tr>
------------------
Code Behind:
RegularExpression_FileUpload_PO.ToolTip = String.Format("{0}{1}{2}", "We only accept ", ConfigurationManager.AppSettings("ValidUploadPOExtension"), " file types.")

If lblPOUploadOriginalFilename.Text = "" Then
lnkbtnPOUploadLink.Visible = True
lnkbtnPORemoveLink.Visible = False
Else
lnkbtnPOUploadLink.Visible = False
lnkbtnPORemoveLink.Visible = True
End If
Select Case oMiscellaneousInvoice.BillToEditMode

Case clsMiscellaneousInvoice.BillToEditModes.Add
PnlCreditCard.Style.Add("display", "none")
PnlWire.Style.Add("display", "none")
PnlPO.Style.Add("display", "none")
PnlACH.Style.Add("display", "none")

PnlBillToEdit.Visible = True
ddlPaymentType.Visible = True
trDefault_CreditCard.Visible = oMiscellaneousInvoice.AllowSaveBillTo
trDefault_PO.Visible = oMiscellaneousInvoice.AllowSaveBillTo
trDefault_Wire.Visible = oMiscellaneousInvoice.AllowSaveBillTo
trDefault_ACH.Visible = oMiscellaneousInvoice.AllowSaveBillTo

BindDropDownListByValue(Me.ddlPaymentType, dtPaymentTypes, ddlPaymentType.SelectedValue.ToString)

If SameasSoldTo = False Then
BindDropDownListByText(Me.ddlBillToCountry, ViewState("dtCountries"), drBillToEdit("CountryID"))
If ddlBillToCountry.SelectedValue = hdnUSACountryID.Value Then
divBillToUSAddress.Style.Add("display", "b

1 solution

I think your scenario is as same as this case:
FileUpload control working on second click but not first attempt [^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900