asp.net Ajax之无刷新评论介绍;需要的朋友可以参考下
首先还是建一个DoComments.aspx页面和一个DealComments.ashx页面(代码基本上都有注释,如果没写注释,请先看前几篇!)。
Docomments.aspx页面中的代码为:
<%–
用户名
内容
<table style="width: 700px; border: 1px solid #000; text-align: left;" border="1"
cellpadding=”0″ cellspacing=”0″>
发布内容:
Docomments.aspx页面中的代码为:
代码如下:
评论信息:
<table id="commentTable" style="width: 600px; border: 1px solid #000;" border="1"
cellpadding=”0″ cellspacing=”0″>
–%>
<table style="width: 700px; border: 1px solid #000; text-align: left;" border="1"
cellpadding=”0″ cellspacing=”0″>
DealComments.ashx中的代码如下:
代码如下:
public void ProcessRequest(HttpContext context)
{
string strComment = context.Request.Form[“txtComments”];//获得传过来的内容
if (string.IsNullOrEmpty(strComment))//如果不为空,返回ture
{
context.Response.Write(“true”);
}
else
{
context.Response.Write(“false”);
}
context.Response.End();
}
{
string strComment = context.Request.Form[“txtComments”];//获得传过来的内容
if (string.IsNullOrEmpty(strComment))//如果不为空,返回ture
{
context.Response.Write(“true”);
}
else
{
context.Response.Write(“false”);
}
context.Response.End();
}
简单吧!初学的童鞋……呵呵、、、、、、本系列只适合初学者,请大牛勿笑啊!
以上就是asp.net Ajax之无刷新评论介绍的详细内容,更多请关注g来源gaodai#ma#com搞*!代#%^码网aodaima搞代码网其它相关文章!