<
telerik:RadEditor
DialogHandlerUrl
=
"~/Telerik.Web.UI.DialogHandler.axd"
ID
=
"edtHomePageContent"
runat
=
"server"
Width
=
"100%"
ImageManager-ViewPaths
=
"~/assets/img"
ImageManager-UploadPaths
=
"~/assets/img"
ImageManager-DeletePaths
=
"~/assets/img"
DocumentManager-DeletePaths
=
"~/assets/files"
DocumentManager-UploadPaths
=
"~/assets/files"
DocumentManager-ViewPaths
=
"~/assets/files"
FlashManager-DeletePaths
=
"~/assets/videos"
FlashManager-UploadPaths
=
"~/assets/videos"
FlashManager-ViewPaths
=
"~/assets/videos"
MediaManager-DeletePaths
=
"~/assets/files"
MediaManager-UploadPaths
=
"~/assets/files"
MediaManager-ViewPaths
=
"~/assets/files"
TemplateManager-DeletePaths
=
"~/assets/templates"
TemplateManager-UploadPaths
=
"~/assets/templates"
TemplateManager-ViewPaths
=
"~/assets/templates"
>
<
CssFiles
>
<
telerik:EditorCssFile
Value
=
"~/style.css"
/>
</
CssFiles
>
</
telerik:RadEditor
>
<
location
path
=
"admin/Telerik.Web.UI.DialogHandler.axd"
>
<
system.web
>
<
authorization
>
<
allow
users
=
"?"
/>
</
authorization
>
</
system.web
>
</
location
>
<
location
path
=
"admin/Telerik.Web.UI.SpellCheckHandler.axd"
>
<
system.web
>
<
authorization
>
<
allow
users
=
"?"
/>
</
authorization
>
</
system.web
>
</
location
>
<
location
path
=
"Telerik.Web.UI.DialogHandler.axd"
>
<
system.web
>
<
authorization
>
<
allow
users
=
"?"
/>
</
authorization
>
</
system.web
>
</
location
>
<
location
path
=
"Telerik.Web.UI.SpellCheckHandler.axd"
>
<
system.web
>
<
authorization
>
<
allow
users
=
"?"
/>
</
authorization
>
</
system.web
>
</
location
>
<
system.web
>
<
authorization
>
<
allow
users
=
"user1"
/>
</
authorization
>
<
httpHandlers
>
<
remove
verb
=
"*"
path
=
"*.asmx"
/>
<
add
verb
=
"*"
path
=
"*.asmx"
validate
=
"false"
type
=
"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
verb
=
"*"
path
=
"*_AppService.axd"
validate
=
"false"
type
=
"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
verb
=
"*"
path
=
"Telerik.Web.UI.DialogHandler.axd"
type
=
"Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
/>
<
add
path
=
"Telerik.Web.UI.DialogHandler.axd"
type
=
"Telerik.Web.UI.DialogHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"Telerik.Web.UI.SpellCheckHandler.axd"
type
=
"Telerik.Web.UI.SpellCheckHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
verb
=
"GET,HEAD"
path
=
"ScriptResource.axd"
type
=
"System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
validate
=
"false"
/>
<
add
path
=
"ChartImage.axd"
type
=
"Telerik.Web.UI.ChartHttpHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"Telerik.RadUploadProgressHandler.ashx"
type
=
"Telerik.Web.UI.RadUploadProgressHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"Telerik.Web.UI.WebResource.axd"
type
=
"Telerik.Web.UI.WebResource"
verb
=
"*"
validate
=
"false"
/>
</
httpHandlers
>
<
httpModules
>
<
add
name
=
"ScriptModule"
type
=
"System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
</
httpModules
>
</
system.web
>
<
system.webServer
>
<
validation
validateIntegratedModeConfiguration
=
"false"
/>
<
modules
>
<
remove
name
=
"ScriptModule"
/>
<
add
name
=
"ScriptModule"
preCondition
=
"managedHandler"
type
=
"System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
</
modules
>
<
handlers
>
<
remove
name
=
"WebServiceHandlerFactory-Integrated"
/>
<
remove
name
=
"ScriptHandlerFactory"
/>
<
remove
name
=
"ScriptHandlerFactoryAppServices"
/>
<
remove
name
=
"ScriptResource"
/>
<
remove
name
=
"WebServiceHandlerFactory-ISAPI-2.0"
/>
<
remove
name
=
"ChartImage_axd"
/>
<
remove
name
=
"Telerik_Web_UI_SpellCheckHandler_axd"
/>
<
remove
name
=
"Telerik_Web_UI_DialogHandler_axd"
/>
<
remove
name
=
"Telerik_RadUploadProgressHandler_ashx"
/>
<
remove
name
=
"Telerik_Web_UI_WebResource_axd"
/>
<
add
name
=
"ScriptHandlerFactory"
verb
=
"*"
path
=
"*.asmx"
preCondition
=
"integratedMode"
type
=
"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
name
=
"ScriptHandlerFactoryAppServices"
verb
=
"*"
path
=
"*_AppService.axd"
preCondition
=
"integratedMode"
type
=
"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
name
=
"ScriptResource"
preCondition
=
"integratedMode"
verb
=
"GET,HEAD"
path
=
"ScriptResource.axd"
type
=
"System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
name
=
"ChartImage_axd"
path
=
"ChartImage.axd"
type
=
"Telerik.Web.UI.ChartHttpHandler"
verb
=
"*"
preCondition
=
"integratedMode,runtimeVersionv2.0"
/>
<
add
name
=
"Telerik_Web_UI_SpellCheckHandler_axd"
path
=
"Telerik.Web.UI.SpellCheckHandler.axd"
type
=
"Telerik.Web.UI.SpellCheckHandler"
verb
=
"*"
preCondition
=
"integratedMode,runtimeVersionv2.0"
/>
<
add
name
=
"Telerik_Web_UI_DialogHandler_axd"
path
=
"Telerik.Web.UI.DialogHandler.axd"
type
=
"Telerik.Web.UI.DialogHandler"
verb
=
"*"
preCondition
=
"integratedMode,runtimeVersionv2.0"
/>
<
add
name
=
"Telerik_RadUploadProgressHandler_ashx"
path
=
"Telerik.RadUploadProgressHandler.ashx"
type
=
"Telerik.Web.UI.RadUploadProgressHandler"
verb
=
"*"
preCondition
=
"integratedMode,runtimeVersionv2.0"
/>
<
add
name
=
"Telerik_Web_UI_WebResource_axd"
path
=
"Telerik.Web.UI.WebResource.axd"
type
=
"Telerik.Web.UI.WebResource"
verb
=
"*"
preCondition
=
"integratedMode,runtimeVersionv2.0"
/>
</
handlers
>
</
system.webServer
>
.dataPagerClass .rdpWrap .RadInput,
.dataPagerClass .rdpWrap .rdpPagerButton,
.dataPagerClass .rdpWrap .rdpPagerLabel
{
float: left;
text-decoration: none;
}
<
telerik:RadListView
ID
=
"RadListView1"
runat
=
"server"
AllowPaging
=
"True"
ItemPlaceholderID
=
"PlaceHolder1"
Skin
=
"listview_2"
EnableEmbeddedSkins
=
"false"
OnItemCreated
=
"RadListView1_ItemCreated"
DataKeyNames
=
"id,filenameextension,typeAbbr,title"
OnNeedDataSource
=
"RadListView1_NeedDataSource"
>
<
LayoutTemplate
>
<
div
class
=
"RadListView RadListViewFloated RadListView_Windows7"
>
<
telerik:RadDataPager
ID
=
"RadDataPager1"
runat
=
"server"
PageSize
=
"25"
PagedControlID
=
"RadListView1"
BorderWidth
=
"0"
OnFieldCreated
=
"RadDataPager1_FieldCreated"
CssClass
=
"dataPagerClass"
>
<
Fields
>
<
telerik:RadDataPagerButtonField
FieldType
=
"FirstPrev"
/>
<
telerik:RadDataPagerButtonField
FieldType
=
"Numeric"
PageButtonCount
=
"5"
/>
<
telerik:RadDataPagerButtonField
FieldType
=
"NextLast"
/>
<
telerik:RadDataPagerPageSizeField
PageSizeText
=
"Page size: "
/>
<
telerik:RadDataPagerGoToPageField
CurrentPageText
=
"Page: "
TotalPageText
=
"of"
SubmitButtonText
=
"Go"
TextBoxWidth
=
"15"
/>
<
telerik:RadDataPagerTemplatePageField
>
<
PagerTemplate
>
<
b
>Total Number of Assets Found:
<
asp:Label
runat
=
"server"
ID
=
"TotalItemsLabel"
Text="<%# Container.Owner.TotalRowCount%>" />
</
b
>
</
PagerTemplate
>
</
telerik:RadDataPagerTemplatePageField
>
</
Fields
>
</
telerik:RadDataPager
>
<
asp:PlaceHolder
ID
=
"PlaceHolder1"
runat
=
"server"
/>
</
div
>
</
LayoutTemplate
>
<
ItemTemplate
>
<
div
style
=
"float: left; width: 162px; height: 200px; background-color: White;"
>
<
asp:Panel
ID
=
"myThumb"
runat
=
"server"
CssClass
=
"myClass"
Style="border: 0; white-space: normal;
padding: 5px 2px 25px 2px; text-align: center; width: 156px; background-color: White;">
<
asp:HyperLink
ID
=
"HyperLink1"
runat
=
"server"
>
<
telerik:RadBinaryImage
ID
=
"RadBinaryImage1"
runat
=
"server"
AutoAdjustImageControlSize
=
"False"
CssClass
=
"myClass"
ImageUrl='<%# Eval("thumbUrl") %>' AlternateText="Click to view preview"
ToolTip="Click to view preview" Width="150px" Height="150px" />
</
asp:HyperLink
><
br
/>
<
asp:CheckBox
ID
=
"ChkImage"
runat
=
"server"
Style
=
"float: left; padding-top: 5px"
/><
small
><
asp:HyperLink
ID
=
"lnkAsset1"
runat
=
"server"
Visible
=
"false"
Style="float: left; padding-top: 5px;
text-decoration: none; font-weight: normal; font-size: 7pt;">
</
asp:HyperLink
><
asp:HyperLink
ID
=
"lnkAsset2"
runat
=
"server"
Style="float: left;
text-decoration: none; font-weight: normal; font-size: 7pt;">
</
asp:HyperLink
><
asp:HyperLink
ID
=
"lnkAsset3"
runat
=
"server"
Style="float: left;
padding-left: 20px; text-decoration: none; font-weight: normal; font-size: 7pt;"></
asp:HyperLink
></
small
><
br
/>
<
asp:HiddenField
ID
=
"hiddenAssetId"
Value='<%# Eval("id") %>' runat="server" />
</
asp:Panel
>
</
div
>
</
ItemTemplate
>
<
EmptyDataTemplate
>
No Assets Found
</
EmptyDataTemplate
>
</
telerik:RadListView
>
<
telerik:RadOrgChart
ID
=
"RadOrgChart1"
runat
=
"server"
DataFieldID
=
"Id"
DataTextField
=
"Name"
DataFieldParentID
=
"ManagerId"
Skin
=
"Windows7"
GroupColumnCount
=
"4"
>
</
telerik:RadOrgChart
>
this
.RadOrgChart1.DataSource = from emp
in
new
TestDataContext().Employees select emp;
this
.RadOrgChart1.DataBind();
I have a RadWindowManager with RadWindow that opens a new window when a link within a RadGrid cell is clicked. It opens the new window as a Modal="true". In the new window's aspx page, it has a RadUpload, RadProgressArea and RadProgressManager, that uses TargetFolder="~/UploadFiles" and OverwriteExistingFiles="false". What I would like is for it to check to see if the file exists already when the user submits the file. If so, I want to present a javascript confirm() box to the user to ask if they want to overwrite the file. If yes, then let it overwrite (and store the extra data in the database), if no, return back to the RadUpload popup window without saving the file (thus allowing them to cancel the process, rename the file on their hard drive and then re-upload). I have tried using the submit button's click event handler to check for the file's existance, and if so, it calls a ClientScript.RegisterClientScriptBlock to register a confirm() box. However, it doesn't seem to either fire or attach properly (or some other reason I can't figure out). I've tried a number of different ways, but none are working. The current version uses a hidden field to track if the file exists or not, but it's not working. Any thoughts?
ASPX:
<
script
type
=
"text/javascript"
>
function CloseAndRebind() {
GetRadWindow().BrowserWindow.refreshGrid();
GetRadWindow().close();
}
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
function CancelEdit() {
GetRadWindow().close();
}
function ExecuteConfirm() {
var returnValue = confirm('Warning: File exists. Wanna overwrite?');
if (returnValue) {
document.getElementById('FileExistsHidden').value = "1";
document.getElementById('SubmitButton').click();
}
}
</
script
>
<
telerik:RadUpload
ID
=
"FileRadUpload"
runat
=
"server"
ControlObjectsVisibility
=
"ClearButtons"
InitialFileInputsCount
=
"1"
MaxFileInputsCount
=
"1"
TargetFolder
=
"~/UploadFiles"
OverwriteExistingFiles
=
"false"
InputSize
=
"45"
Width
=
"500px"
>
</
telerik:RadUpload
>
<
telerik:RadProgressArea
ID
=
"RadProgressArea1"
runat
=
"server"
DisplayCancelButton
=
"true"
ProgressIndicators
=
"TotalProgressBar, TotalProgress, RequestSize, FilesCountBar, FilesCount, SelectedFilesCount, CurrentFileName, TimeElapsed, TimeEstimated, TransferSpeed"
>
</
telerik:RadProgressArea
>
<
telerik:RadProgressManager
ID
=
"RadProgressManager1"
runat
=
"server"
/>
<
hr
/>
<
asp:Button
ID
=
"SubmitButton"
runat
=
"server"
Text
=
"Submit"
onclick
=
"SubmitButton_Click"
/>
<
asp:HiddenField
ID
=
"FileExistsHidden"
runat
=
"server"
/>
protected void SubmitButton_Click(object sender, EventArgs e)
{
int customerDataId = MathHelper.ParseIntZeroIfNull(Request.QueryString.Get("cdid"));
Type cstype = GetType();
string warningScriptName = "PopupScript";
string rebindScriptName = "RebindScript";
ClientScriptManager cs = Page.ClientScript;
if (FileRadUpload.UploadedFiles.Count > 0)
{
if (customerDataId > 0)
{
Customers customers = new Customers();
foreach (UploadedFile file in FileRadUpload.UploadedFiles)
{
if (customers.CustomerFileExists(file.GetName()))
{
if (FileExistsHidden.Value != "1")
{
if (!cs.IsClientScriptBlockRegistered(SubmitButton.GetType(), warningScriptName))
{
cs.RegisterClientScriptBlock(GetType(), SubmitButton.ID, "ExecuteConfirm();", true);
}
}
else
{
FileExistsHidden.Value = "";
}
}
else
{
customers.InsertCustomerFile(customerDataId, file.GetName(), Portal.GetIdsid);
}
}
}
}
if (!cs.IsClientScriptBlockRegistered(GetType(), rebindScriptName))
{
cs.RegisterClientScriptBlock(cstype, rebindScriptName, "CloseAndRebind();", true);
}
}