hehe ,xml 的标记不同于html标记.看看源代码你就明白
<?xml version='1.0' encoding='GB2312'?>
<?xml-stylesheet type='text/xsl' href='/expert/Xsl/2.xsl'?>
<Topic>
<Issue>
<PostUserNickName></PostUserNickName>
<rank>一级(初级)</rank>
<ranknum>user1</ranknum>
<credit> 100</credit>
<TopicId> 2177241</TopicId>
<TopicName>关于显示格式.</TopicName>
<PostUserId>418062</PostUserId>
<PostUserName>jiavia</PostUserName>
<RoomName>.NET技术 ASP.NET</RoomName>
<ReplyNum>0</ReplyNum>
<PostDateTime>2003-08-22 14:47:53</PostDateTime>
<Point>100</Point>
<ReadNum>0</ReadNum>
<RoomId>5202</RoomId>
<EndState>0</EndState>
<Content>各位朋友,我想问一个关于显示的问题.
   比如我们在CSDN上提问题,我们写的内容的格式有的带空格,有的是好多行.总之我们写的内容格式是怎么样到时候显示出来别人看到的就是什么样.这怎么实现呢?
   我是将发帖的内容贮存到数据库,然后用DataGrid显示出来.可是无法显示出输入时的格式.
   比如:输入时我们习惯先两个空格,写一定文字换行.(我这个帖子就是7行).
   那么怎样才能显示输入时的格式呢?</Content>
</Issue>
<Replys>
</Replys>
</Topic>
<?xml version='1.0' encoding='GB2312'?>
<?xml-stylesheet type='text/xsl' href='/expert/Xsl/2.xsl'?>
<Topic>
<Issue>
<PostUserNickName></PostUserNickName>
<rank>一级(初级)</rank>
<ranknum>user1</ranknum>
<credit> 100</credit>
<TopicId> 2177241</TopicId>
<TopicName>关于显示格式.</TopicName>
<PostUserId>418062</PostUserId>
<PostUserName>jiavia</PostUserName>
<RoomName>.NET技术 ASP.NET</RoomName>
<ReplyNum>0</ReplyNum>
<PostDateTime>2003-08-22 14:47:53</PostDateTime>
<Point>100</Point>
<ReadNum>0</ReadNum>
<RoomId>5202</RoomId>
<EndState>0</EndState>
<Content>各位朋友,我想问一个关于显示的问题.
   比如我们在CSDN上提问题,我们写的内容的格式有的带空格,有的是好多行.总之我们写的内容格式是怎么样到时候显示出来别人看到的就是什么样.这怎么实现呢?
   我是将发帖的内容贮存到数据库,然后用DataGrid显示出来.可是无法显示出输入时的格式.
   比如:输入时我们习惯先两个空格,写一定文字换行.(我这个帖子就是7行).
   那么怎样才能显示输入时的格式呢?</Content>
</Issue>
<Replys>
</Replys>
</Topic>
private string formatString(string str)
{
str=str.Replace(" "," ");//处理空格
str=str.Replace("<","<");//处理小于号
str=str.Replace(">",">");//处理大于号
str=str.Replace("\n","<br>");//处理换行
return str;
}然后,在添加到数据库时,不是添加TextBox1.Text到数据库,而是添加myText
(其中myText=formatString(TextBox1.Text.ToString());)
关于客户端输入事件是有的,双击就可得到事件.
当然.其它mouse等或其它事件可以附加到控件的.用控件的Attributes的AddAttributes或Add方法添加js事件属性!