gives me the following error:
Error 1 Operator '&=' cannot be applied to operands of type 'Telerik.WebControls.ProgressIndicators' and 'Telerik.Web.UI.Upload.ProgressIndicators'
Error 2 Cannot implicitly convert type 'Telerik.Web.UI.Upload.ProgressIndicators' to 'Telerik.WebControls.ProgressIndicators'. An explicit conversion exists (are you missing a cast?)
7 Answers, 1 is accepted
It seems you have references to both RadUpload for ASP.NET (RadUpload.Net2.dll) and RadControls for ASP.NET Ajax (Telerik.Web.UI.dll). Please, remove the redundant using clause. By the way, you could remove the reference to the redundant assembly also (e.g. RadUpload.Net2).
All the best,
Erjan Gavalji
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
<
httpHandlers>
<
add path="ChartAxd.axd" verb="*" type="Dundas.Charting.WebControl.ChartHttpHandler" validate="false"/>
<
add verb="*" path="Telerik.RadUploadProgressHandler.aspx" type="Telerik.WebControls.RadUploadProgressHandler, RadUpload.Net2" />
</
httpHandlers>
<
httpModules>
<
add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<
add name="RadUploadModule" type="Telerik.WebControls.RadUploadHttpModule, RadUpload.Net2" />
</
httpModules>
and here is my cs page:
using
System;
using
System.Collections;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Web;
using
System.Web.SessionState;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.UI.HtmlControls;
using
Telerik.Web.UI;
using
Telerik.Web.UI.Upload;
public
partial class UploadFile : System.Web.UI.Page
{
protected void Page_Load(object sender, System.EventArgs e)
{
RadProgressArea1.ProgressIndicators &= ~
ProgressIndicators.SelectedFilesCount;
}
protected void buttonSubmit_Click(object sender, System.EventArgs e)
{
UploadedFile file = UploadedFile.FromHttpPostedFile(Request.Files[File1.UniqueID]);
if(!Object.Equals(file, null))
{
LooongMethodWhichUpdatesTheProgressContext(file);
}
}
private void LooongMethodWhichUpdatesTheProgressContext(UploadedFile file)
{
const int total = 100;
RadProgressContext progress = RadProgressContext.Current;
for (int i = 0; i < total; i++)
{
progress.PrimaryTotal = 1;
progress.PrimaryValue = 1;
progress.PrimaryPercent = 100;
progress.SecondaryTotal = total;
progress.SecondaryValue = i;
progress.SecondaryPercent = i;
progress.CurrentOperationText = file.GetName() +
" is being processed...";
if (!Response.IsClientConnected)
{
//Cancel button was clicked or the browser was closed, so stop processing
break;
}
//Stall the current thread for 0.1 seconds
System.Threading.
Thread.Sleep(100);
}
}
}
Indeed, the web.config file denotes you use the HttpModule and HttpHandler of RadUpload for ASP.NET "Classic". It seems that you have RadUpload for ASP.NET "Classic" on the page and you have a using Telerik.Web.UI clause in the code file.
Please, use the following syntax:
RadProgressArea1.ProgressIndicators &= ~Telerik.WebControls.ProgressIndicators.SelectedFilesCount
Regards,
Erjan Gavalji
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
The page run now without error and file is uploaded BUT the Progress bar does not appear at all.....Please help me urgently as I may lose my client because of delay in delivery.
How Can i send you the files to see the whole code inline.
Best Regards
Yasser
Please, check the list in the RadProgressArea does not wok article. Most probably the reason for the error you experience is described there.
Regards,
Erjan Gavalji
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
~
- The project is hosted in IIS7. RadMemoryOptimization is not supported in IIS7 yet. " I am Using the VisualStudio 2005 Web Development Server "
- RadUploadHttpModule and / or RadUploadProgressHandler are not registered in web.config. "I already Registered on Web Config"
- There is no RadProgressManager on the page. "There is one"
- The files are uploaded with AJAX call. "No Ajax Control"
- There is a URL rewriter in the application. "How Can I test this??????????????????????????????????? "
- There are other HTTP modules in the application which are designed to handle file uploads. "Not Exist"
- The application level trace is enabled in web.config. "Trace is Disable"
- The application is hosted in a web garden or web farm."No web garden or Web Farm"
If a URL rewriter exists, it would be located either in the application source code, or in some of the referred assemblies. Typically a URL rewriter is added using the Global.asax file.
You could open a formal support ticket to send us the files.
Regards,
Erjan Gavalji
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.