in the Editor, click on the Image Manager tool, then click "Upload",
uncheck "Overwrite if file exists?".
If I upload three existing files, I get an alert dialog with three times of "A file with a name same as the target already exists!".
Is there a way to only display one error message "A file with a name same as the target already exists!"?
I found a post and it seems like the solution doesn't work for me or maybe I miss something.
http://www.telerik.com/community/forums/aspnet-ajax/file-explorer/alert-on-file-exists-is-multiplied-with-the-number-of-uploads.aspx
I'm using custom control which inherited from RadEditor.
I tried to add the following code in the custom control, but rfe is always null.
protected override void EnsureChildControls()
......
Telerik.Web.UI.RadFileExplorer rfe =
(Telerik.Web.UI.RadFileExplorer)this.FindRadControl(this.Page);
if (rfe != null)
{
rfe.ItemCommand += new RadFileExplorerEventHandler(radFileExplorer_ItemCommand);
}
}
private Control FindRadControl(Control parent)
{
foreach (Control c in parent.Controls)
{
if (c is Telerik.Web.UI.RadFileExplorer) return c;
if (c.Controls.Count > 0)
{
Control sub = FindRadControl(c);
if (sub != null) return sub;
}
}
return null;
}
protected void radFileExplorer_ItemCommand(object sender, RadFileExplorerEventArgs e)
{
switch (e.Command)
{
case "UploadFile":
//should I check the existence here?
break;
default:
break;
}
}
uncheck "Overwrite if file exists?".
If I upload three existing files, I get an alert dialog with three times of "A file with a name same as the target already exists!".
Is there a way to only display one error message "A file with a name same as the target already exists!"?
I found a post and it seems like the solution doesn't work for me or maybe I miss something.
http://www.telerik.com/community/forums/aspnet-ajax/file-explorer/alert-on-file-exists-is-multiplied-with-the-number-of-uploads.aspx
I'm using custom control which inherited from RadEditor.
I tried to add the following code in the custom control, but rfe is always null.
protected override void EnsureChildControls()
......
Telerik.Web.UI.RadFileExplorer rfe =
(Telerik.Web.UI.RadFileExplorer)this.FindRadControl(this.Page);
if (rfe != null)
{
rfe.ItemCommand += new RadFileExplorerEventHandler(radFileExplorer_ItemCommand);
}
}
private Control FindRadControl(Control parent)
{
foreach (Control c in parent.Controls)
{
if (c is Telerik.Web.UI.RadFileExplorer) return c;
if (c.Controls.Count > 0)
{
Control sub = FindRadControl(c);
if (sub != null) return sub;
}
}
return null;
}
protected void radFileExplorer_ItemCommand(object sender, RadFileExplorerEventArgs e)
{
switch (e.Command)
{
case "UploadFile":
//should I check the existence here?
break;
default:
break;
}
}