如何在.net生成的新闻静态页面里添加"提交评论"与显示该新闻的所有评论?

解决方案 »

  1.   

    看你的结贴率。
    用ajax提交和显示,要不就做个连接,引导到留言页
      

  2.   

    javascript 中 自己写局部刷新,在服务端用 .ashx写类似代码
                context.Response.Write("<table id='tab_" + sub.Sort.ToString() + "' border='1' cellpadding='3' cellspacing='3' bordercolor=#008000 width='" + width.ToString() + "px'> ");
                context.Response.Write(" <tr bgcolor='lightyellow'> ");
                context.Response.Write(" <td width='222px' >发言时间:" + sub.UpLoadDate + "</td> ");
                context.Response.Write(" <td >给 “" + sub.ToAuthor + "” 的留言</td> ");
                context.Response.Write(" </tr> ");
                context.Response.Write(" <tr bgcolor='lightcyan'> ");
                context.Response.Write(" <td width='222px'> <img id='AuthorSub_" + sub.Sort.ToString() + "' src='images/zuozhe.GIF' " +
                    " onmouseover=\"AboutYonghu('replaceconsole','AuthorSub_" + sub.Sort.ToString() + "','getProfile.aspx?width=300&','" + sub.Author + "')\" " +
                    " onmouseout=\"HideAboutZuoZhe('replaceconsole')\" alt='' />");
                context.Response.Write(sub.Sort.ToString() + "楼:" + sub.Author);
    最后
    用javascript 写到div的innerHTML 属性中
    另外还要使用XMLHttpRequest
    象下面的function AjaxRequest(_url, _showdata) {
        if (window.XMLHttpRequest) {
            request = new XMLHttpRequest();
        } else if (window.ActiveXObject) {
            request = new ActiveXObject("Microsoft.XMLHTTP");
        }
        if (request) {
            p_showdata=_showdata;
            request.onreadystatechange = processReqChange;
            request.open("GET", _url, true);
            request.send(null);
        }
    }
    有点麻烦,可以试试http://www.mybuffet.cn
      

  3.   

    我是ASP.NET新手,请大家能说详细点吗?
     或者加我QQ229970437,本人有点急,请大家帮忙下,本人会非常感激的。
      

  4.   

    如果不会ajax ,就用iframe.在写个页面。
      

  5.   

    做好一个评论页面,然后用iframe来做
      

  6.   

    用iframe吧,快速方便不然,用Ajax最好了
      

  7.   

    iframe没有ajax好 但是的确方便
    可以看看4楼写的代码
      

  8.   

    你可以直接用button调用一个js方法,ajax调用
    也可以该button为sumit提交你的信息到另一个页面里面保存