100分求修改以下HTML代码为服务器端代码
100分求修改以下HTML代码为服务器端代码,也不知道是不是叫做服务器端代码,就是想让这些代码中的FCKeditor可以正常运行就可以,不明白的可以留言给我。
下面是完整代码:
Gbook.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Gbook.aspx.cs" Inherits="_28_1.Gbook" validateRequest="false" %><%@ Register Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %><!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="css/css.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="fckeditor/fckeditor.js"></script> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> <script src="jquery-1.6.4.min.js" type="text/javascript"></script> <script type="text/javascript"> function getEditorHTMLContents(EditorName) { //var oEditor = FCKeditorAPI.GetInstance(EditorName); //alert(oEditor); // var oEditor = "xyzabcd"+oEditor.value.toString(); //var editorHtml = (oEditor.GetXHTML(true)); var editor = FCKeditorAPI.GetInstance(EditorName); var editor2=editor.EditorDocument.body.innerText; return editor2; } </script></head><body style="background:white url(images/bg.png) repeat-x; height: 1709px;"> <form id="form1" runat="server"> <div class="gbook_banner"> <img alt="" src="images/groups.png" style="width: 16px; height: 16px" /> <asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="~/login.aspx">登录</asp:LinkButton> <img alt="" src="images/gift.png" style="width: 16px; height: 16px" /> <asp:LinkButton ID="LinkButton2" runat="server" PostBackUrl="~/register.aspx">注册</asp:LinkButton> <img alt="" src="images/list.png" style="width: 16px; height: 16px" /> <asp:LinkButton ID="LinkButton3" runat="server" PostBackUrl="~/admin/login.aspx">留言管理</asp:LinkButton> <asp:Button ID="Button4" runat="server" Height="25px" onclick="Button4_Click1" Text="我的留言" Width="84px" Visible="False" /> <asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="注销" Visible="False" /> </div> <div class="gbook_main"> <div id="result"> </div> <div style="height: 205px"> <script type="text/javascript"> var pageNo = 1; //当前页号 var pageItems = 3; //每页显示的行数,这个数字与da.Fill(ds,pageNo,3,"gbook");里面的3保持一致 var MaxPage = pageItems; function showPage(m) { if (m == -1) { if (pageNo < 2) { alert("已经到了首页"); return; }; MaxPage = pageItems; } else { if (MaxPage < pageItems) { alert("已经到了末页"); return; }; } pageNo += m; getData(); } $(document).ready(function () { getData(); }); function getData() { $.ajax({ type: "POST", cache: false, url: "WebService.asmx/Select", /* 注意后面的名字对应CS的方法名称 */ data: { "pageNo": (pageNo - 1) * pageItems }, /* 注意参数的格式和名称 */ contentType: "application/x-www-form-urlencoded", dataType: "xml", error: function (result) { alert(result.responseText); }, success: function (data) { MaxPage = $(data).find('gbook').size(); t = "<table border='1'>"; //t = ""; $(data).find('gbook').each(function (index, ele) { var id = $(ele).find('id').text(); var title = $(ele).find('title').text(); var name = $(ele).find('name').text(); var time = $(ele).find('time').text(); var content = $(ele).find('content').text(); var reptime = $(ele).find('reptime').text(); var repcontent = $(ele).find('repcontent').text(); t += "<tr>"; t += "" + "ID:" + id + "<tr/>"; t += "" + "标题:" + title + "<tr/>"; t += "" + "留言人:" + name + "<tr/>"; t += "" + "留言时间:" + time + "<tr/>"; t += "" + "留言内容:" + content + "<tr/>"; t += "" + "回复时间:" + reptime + "<tr/>"; t += "" + "回复内容:" + repcontent + "<tr/>"; t += "" + "<input type=button value='删除此留言' onclick='deleteData(" + id + ")'/><tr/>"; t += "" + "<div><input type='hidden' id='FCKeditor1' name='FCKeditor1' value='' /><input type='hidden' id='FCKeditor1___Config' value='HtmlEncodeOutput=true' /><iframe id='FCKeditor1___Frame' src='fckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&Toolbar=Default' width='700px' height='400px' frameborder='no' scrolling='no'></iframe></div><tr/>"; t += "" + "<input id=replybutton type=button value='回复此留言' onclick='replyData(" + id + ")'/><tr/>"; t += "" + "<hr color=#987cb9 size=5>" + "<tr/>"; t += "</tr>"; }) //t += "</table>"; t += "<div><a href='' onclick='showPage(-1);return false;'>上一页</a> <a href='' onclick='showPage(1);return false;'>下一页</a></div>"; $("#result").html(t); } }); } function deleteData(id) { $.ajax({ type: "POST", cache: false, url: "WebService.asmx/Delete", /* 注意后面的名字对应CS的方法名称 */ data: { "id": id }, /* 注意参数的格式和名称 */ contentType: "application/x-www-form-urlencoded", dataType: "xml", success: function (ret) { //判断 ret 删除成功再决定是否刷新getData(); getData(); } }); } function replyData(id) { //回复留言函数 var textarea1 = getEditorHTMLContents("FCKeditor1"); // alert(textarea1); $.ajax({ type: "POST", cache: false, url: "WebService.asmx/Update", /* 注意后面的名字对应CS的方法名称 */ data: { "id": id, "textarea1": textarea1 }, /* 注意参数的格式和名称 */ contentType: "application/x-www-form-urlencoded", dataType: "xml", success: function (ret) { // alert("2"); //判断 ret 删除成功再决定是否刷新getData(); getData(); //alert("3"); } }); } </script> </div> </div> </form> </body></html>