Posts

Showing posts from August, 2013

RadDatePicker Invalid Date Alert Box

There is no validator in .net that validate raddatepicker's invalid date. in this case we should use raddatepicker's client event on error. <telerik:RadDatePicker  runat="server" ID="rdpStartDate">            <DateInput runat="server">                <ClientEvents OnError=" ValidateDate " />            </DateInput>        </telerik:RadDatePicker> JavaScript function  ValidateDate (sender,args) {            var reason = args.get_reason();            if (reason === 1)             {                 alert("Invalid Date");            }            if (reason === 2)            {                alert("The Date you have typed is out of range");            } }

PowerShell Copy File From One Location to Another

Here is a powershell script that copy files from one location to another in same computer/machine. $CurrentLocationandFileName = " C:\Users\Administrator\Desktop\New.txt " $DestinationLocation = " D:\NewFolder " copy $CurrentLocationandFileName -Destination $DestinationLocation

PowerShell Create Folder or Directory

Here is a powershell script that create a new folder or directory. $FolderPathandName =  " c:\Users\Administrator\Desktop\FolderName " [IO.Directory]::CreateDirectory( $FolderPathandName )

PowerShell Delete Folder or Directory If Exist

Here is a powershell script for delete folder if folder is exist at their location. $Folder=" c:\Users\Administrator\Desktop\NewFolder " If (Test-Path $Folder) { Remove-Item $Folder }