Hi,
I would appreciate it a lot if someone could please help me with this. I have an updatepanel which has a button, which when clicked shows the web dialog window, within the dialog window I have a file upload and a button upload. Apparently ajax does not like the upload control. HasFile is always returning false. What way can I work around this? I have tried using the <Triggers><asp:PostBackTrigger ControlID="" /></Triggers> of the update panel but get an error that it can't find the control.
Can anyone please help?
>_< if only i knew how to make this code look more readable
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<asp:PostBackTrigge<asp:ScriptManager ID="ScriptMaID="UpdatePanel1"
<ContentTemplate>
<
asp:Button ID="btnVendorAdd" runat="server" Text="Add" onclick="btnVendorAdd_Click"/>
<%
--Dialog control for attaching the document--%>
<ig:WebDialogWindow ID="dlgAttachment" runat="server" Height="200px" Width="400px" Modal="True" InitialLocation="Centered" WindowState="Hidden" Font-Names="Calibri" Font-Size="Small" ForeColor="DimGray">
Header CaptionAlignment="Left" CaptionText="Browse for slip...">
<MaximizeBox AltText="Maximize"></MaximizeBox>
<MinimizeBox AltText="Minimize"></MinimizeBox>
<CloseBox Visible="false" />
</Header>
<ContentPane>
<Template>
<asp:Panel ID="pnlFileUpPrompt" runat="server" Visible="true" Width="100%">
<asp:FileUpload ID="fUp" runat="server" />
<asp:Button ID="btnUpload" runat="server" Text="Attach"onclick="btnUpload_Click"/>
</
asp:Panel>
</Template>
</ContentPane>
</ig:WebDialogWindow>
</ContentTemplate>
asp:UpdatePanel>
asp:UpdateProgress ID="UpdateProgress1" runat="server" DynamicLayout="false" AssociatedUpdatePanelID="UpdatePanel1"></asp:UpdateProgress>
asp:Content>
protected void btnVendorAdd_Click(object sender, EventArgs e)
{
dlgAttachment.WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Normal;
}
protected
void btnUpload_Click(object sender, EventArgs e)
this is always returning false.
if
(fUp.HasFile)
Hi Mizu,
I tested your codes. I think, that problem is not related to WebDialogWindow. Because, exactly the same happened if I moved content of dialog directly into UpdatePanel.
I also tried to set trigger to Unique, but it had same result. Though, postback was (probably) full, the file upload failed. To set trigger, I used following:
protected void Page_Load(object sender, EventArgs e) { PostBackTrigger trigger = new PostBackTrigger(); trigger.ControlID = this.btnUpload.UniqueID; this.UpdatePanel1.Triggers.Add(trigger);}
I think that you should move your "upload" controls out of UpdatePanel.
Regards,Viktor
Hi Viktor,
I am experencing the same issue in my application. I have webupload control and webdatagrid in a update panel (say, updPanel1), and a dropdownlist in another update panel (say, updPanel2). I have the triggers in updPanel1 as:
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddl1" EventName="SelectedIndexChanged" />
<asp:AsyncPostBackTrigger ControlID="WebUpload1" EventName="UploadFinished"
/>
</Triggers>
When I upload a file, it should read the value form the dropdownlist, but it always return the original value unless I do a full postback or have postback trigger instead of AsynPostBackTrigger. I cannot have my webupload control outside the update panel and also, I do not want to trigger a full post back!
Is there other workaround for this? I am using 11.1 build 2158 version. Please let me know.
Thanks.
Preet.