<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
	<title></title>
</head>
<body>
	<form id="form1" runat="server">
	<asp:ScriptManager runat="server" ID="ScriptManager1" />
	<script type="text/javascript">

		function changeImageManager(editor, args) {

			if (args.get_commandName() == "MediaManager") {

				var callbackFunction = function (sender, args) {
					var result = args.get_value();
					result = result.replace(/[width|height]=\"[10]?\"/gi, ""); //.replace(/width=\"1\"/gi, "").replace(/height=\"1\"/gi, "");
					editor.pasteHtml(result);
				};
				args.set_callbackFunction(callbackFunction);
			}
		}    
	</script>
	<telerik:RadEditor runat="server" ID="RadEditor1" ExternalDialogsPath="~/EditorDialogs" OnClientCommandExecuting="changeImageManager">
		<MediaManager ViewPaths="~/Documents" UploadPaths="~/Documents" />
		<ImageManager ViewPaths="~/Documents" UploadPaths="~/Documents" />
	</telerik:RadEditor>
	</form>
</body>
</html>
