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)
I have a related issue where the Upload Control's events UploadStarted, UploadFinished, etc. Won't let me read the value of any control that has not done a full postback to the control. I have two checkboxes that always come back with the value they had when the page first rendered regardles of how many times they were clicked unless I have them post back when clicked and handle the event. Then the values can be read correctly. If I put them inside an UpdatePanel I can no longer read the correct value in the same manner as when they didn't post back at all. If I put the upload control inside the update panel with them the upload control disappears when the partial postback occurs. Very frustrating since full page postbacks are frowned upon heavily on my current project.
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.
Hi Preet,
It is not clear if your application uses upload within WebDialogWindow. If yes, then I suggest you to test exactly same functionality without WebDialogWindow? I think that upload will fail by exactly same way as in case when it is located in WebDialogWindow.I assume that failure of upload within async postback is limitaion for that control.
No, it is not in the WebDialogWindow.
So there is not other solution without doing the full post back? I really want to avoid a full postback.
Please let me know.