呵呵.我给个代码你看看吧.UserFaces.html里的图片你自己加几个吧.
sender.aspx:
/////////
<%@ Page Codebehind="sender.aspx.cs" AutoEventWireup="false" Inherits="MyChat.sender" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>sender</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="
http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<script type="text/javascript" src="pub.js"></script>
<script>
function pro(http)
{
if (http.responseText == "未登陆!")
divErr.innerText = http.responseText;
else
divErr.innerText = http.responseText;
}
function Invoke()
{
var msg = sender.document.body.innerHTML;
if(msg =="")
{
alert("不能发送空消息!");
sender.focus();
return;
}
send_request("AM/Sender.aspx?msg=" + msg);
}
function SetFace()
{
var img = showModalDialog("UserFaces.html","","dialogWidth:306px; dialogHeight:240px; status:1; help:1; scroll:yes");
if (img != null)
{
var imgStr = "<img src="+img+" BORDER=0/>";
sender.focus();
var sel = sender.document.selection.createRange();
sel.pasteHTML(imgStr);
}
}
</script>
</HEAD>
<body style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; WIDTH: 0px; CLIP: rect(0px 0px 0px 0px); PADDING-TOP: 0px; HEIGHT: 0px">
<form id="Form1" method="post" runat="server">
<TABLE id="Table2" cellSpacing="0" cellPadding="0" border="0" style="TABLE-LAYOUT: fixed">
<TR>
<TD vAlign="top" style=" WORD-WRAP: break-word"><FONT face="宋体">
<TABLE id="Table1" borderColor="#d0e9f9" cellSpacing="0" cellPadding="0" border="1" style="WIDTH: 537px; HEIGHT: 92px">
<TR>
<TD background="images/toolbarbackground.gif" colSpan="2"><IMG id="btBold" onclick="sender.document.execCommand('Bold');" alt="加粗" loop="1" src="images/bold.gif"
name="btBold" controls="false"> <IMG id="btItalic" onclick="sender.document.execCommand('Italic');" alt="倾斜" src="images/italic.gif"
name="btItalic"> <IMG id="btUnderline" onclick="sender.document.execCommand('Underline');" alt="下划线" src="images/underline.gif"
name="btUnderline">
<SELECT onchange="sender.document.execCommand('fontsize','',this.value);">
<OPTION value="3" selected>字号</OPTION>
<OPTION value="1">1</OPTION>
<OPTION value="2">2</OPTION>
<OPTION value="3">3</OPTION>
<OPTION value="4">4</OPTION>
<OPTION value="5">5</OPTION>
<OPTION value="6">6</OPTION>
<OPTION value="7">7</OPTION>
<OPTION value="8">8</OPTION>
</SELECT>
<SELECT onchange="sender.document.execCommand('fontname','',this.value);">
<OPTION value="宋体" selected>字体</OPTION>
<OPTION value="宋体">宋体</OPTION>
<OPTION value="黑体">黑体</OPTION>
<OPTION value="隶书">隶书</OPTION>
<OPTION value="Arial">Arial</OPTION>
<OPTION value="System">System</OPTION>
</SELECT>
<IMG id="btFace" onclick="SetFace()" alt="表情" src="images/biaoqing.gif" name="btFace">
<SELECT>
<OPTION selected></OPTION>
</SELECT>
</TD>
</TR>
<TR vAlign="middle">
<TD><IFRAME id="sender" name="sender" style="WIDTH: 496px; HEIGHT: 60px" tabIndex="-3" marginWidth="0"
marginHeight="0" scrolling="yes"></IFRAME><INPUT id="msg" type="hidden" runat="server" NAME="msg">
</TD>
<TD><div id="divErr" style="COLOR:red"></div><div id="user1">sss</div>
<input type="button" id="Button1" value="发 送" OnClick="Invoke();" style="WIDTH: 64px; HEIGHT: 62px">
</TD>
</TR>
</TABLE>
</FONT>
</TD>
</TR>
</TABLE>
</form>
<script>
sender.document.designMode = 'On';
</script>
</body>
</HTML>