Hi there,
I've spent hours trying to discover what can be causing this problem and have not managed to find the solution anywhere in the Telerik forums or Knowledge Base yet.
I have a RadProgressArea displaying progress for a single file upload field, which uses an ordinary <input type="file" /> control. The progress area displays correctly when the page is posted back when hitting an Upload button (the button has a causesvalidation="false" attribute so it doesn't trigger the validator mentioned below).
The page also contains a textbox with a (clientside) RequiredFieldValidator, and a Submit button. If the Submit button is clicked when the textbox is empty, the validator correctly prevents the postback from occurring. If the Upload button is subsequently clicked, the upload works (the file size is eventually displayed back to the screen when the upload is complete) but the RadProgressArea does not get displayed.
I'm testing locally so I tend to use large files to test with, 200-300MB
Here's my code:
Can anyone help me out?
Thanks
Nick
I've spent hours trying to discover what can be causing this problem and have not managed to find the solution anywhere in the Telerik forums or Knowledge Base yet.
I have a RadProgressArea displaying progress for a single file upload field, which uses an ordinary <input type="file" /> control. The progress area displays correctly when the page is posted back when hitting an Upload button (the button has a causesvalidation="false" attribute so it doesn't trigger the validator mentioned below).
The page also contains a textbox with a (clientside) RequiredFieldValidator, and a Submit button. If the Submit button is clicked when the textbox is empty, the validator correctly prevents the postback from occurring. If the Upload button is subsequently clicked, the upload works (the file size is eventually displayed back to the screen when the upload is complete) but the RadProgressArea does not get displayed.
I'm testing locally so I tend to use large files to test with, 200-300MB
Here's my code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadUploadTest._Default" %> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<%@ register tagprefix="rad" assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" %> |
<html xmlns="http://www.w3.org/1999/xhtml" > |
<head runat="server"> |
<title>Untitled Page</title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<div> |
<input type="file" id="input" runat="server" /> |
<asp:button id="btn" runat="server" onclick="ClickUpload" text="Upload" causesvalidation="false" /> |
<asp:scriptmanager id="sm" runat="server"></asp:scriptmanager> |
<rad:radprogressarea id="radProgressArea" runat="server" style="z-index: 100;" /> |
<rad:radprogressmanager id="radProgressManager" runat="server" /> |
<br /> |
<br /> |
File size: <asp:literal id="literalFileSize" runat="server" /> |
<br /> |
<br /> |
<br /> |
<br /> |
Description: |
<asp:textbox id="textDescription" runat="server" /> |
<asp:requiredfieldvalidator id="valDescriptionRequired" |
controltovalidate="textDescription" |
display="Dynamic" |
runat="server" |
text="*" /> |
<asp:button id="btnAnotherPostback" runat="server" text="Postback" onclick="ClickPostback" /> |
</div> |
</form> |
</body> |
</html> |
using System; |
using System.Web.UI; |
using Telerik.Web.UI; |
namespace RadUploadTest { |
public partial class _Default : Page { |
protected void ClickUpload(object sender, EventArgs e) { |
RadUploadContext uploadContext = RadUploadContext.Current; |
if (uploadContext != null && uploadContext.UploadedFiles.Count == 1) { |
UploadedFile file = uploadContext.UploadedFiles[0]; |
if (file != null) |
literalFileSize.Text = file.ContentLength.ToString(); |
} |
} |
protected void ClickPostback(object sender, EventArgs e) { |
Page.Validate(); |
} |
} |
} |
Can anyone help me out?
Thanks
Nick