.net 中用编译器kindeditor 上传图片

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

<!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 runat="server">
    <title></title>
     <link href="kindeditor-4.1/themes/default/default.css" rel="stylesheet" type="text/css" />
    <script src="kindeditor-4.1/kindeditor.js" type="text/javascript"></script>
    <script src="kindeditor-4.1/lang/zh_CN.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        KindEditor.ready(function (K) {
            var editor = K.editor({
                uploadJson: 'kindeditor-4.1/asp.net/upload_json.ashx',
                fileManagerJson: 'kindeditor-4.1/asp.net/file_manager_json.ashx',
                allowFileManager: true
            });

            K('#btn').click(function () {
                editor.loadPlugin('image', function () {
                    editor.plugin.imageDialog({
                        imageUrl: K('#url').val(),
                        clickFn: function (url, title, width, height, border, align) {
                            K('#url').val(url);
                            editor.hideDialog();
                        }
                    });
                });
            });
         
        });
  </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <p><input type="text" id="url" value="" /> <input type="button" id="btn" value="选择图片" />(网络图片 + 本地上传)</p>

    </div>
    </form>
</body>
</html>

posted @ 2012-10-30 12:07  沅江  阅读(527)  评论(0编辑  收藏  举报