EXT是一个越来越流行的ajax框架,是迄今为止ajax控件最全的框架,我用来把自己的网站全部改成ajax的,感觉非常不错!
也向网友推荐一下。
留言簿地址:
http://www.addtoo.net/Guestbook.aspx

解决方案 »

  1.   

    为什么在点选【选择表情】的时候页面会刷新一下?
    ——————————————————————————
    是有时候闪一下,EXT要做到兼顾很多浏览器,难免会有一些小瑕疵
      

  2.   

    为什么在点选【选择表情】的时候页面会刷新一下? 
    —————————————————————————— 
    是有时候闪一下,EXT要做到兼顾很多浏览器,难免会有一些小瑕疵
    —————————————————————————— 
    哦,是这样,倒也无大碍。
      

  3.   

    LZ能否把,代码贴出来,叫大家一起学习下。
    ——————————————————
    ajax代码自己点右键查看源文件去下载吧。
      

  4.   

    学习,LZ最好能把源码贴出来
    ——————————————————
    ajax代码自己下载,服务器端代码以后贴出来
      

  5.   

    多行在firefox下只剩一行了。
    ——————————————————
    如果是连贯的字符就会出现这样的情况,要不然会溢出
      

  6.   

    Model 层:
    namespace Addtoo.Model
    {
        [Serializable]
        public class Message
        {
            private int _id;
            private string _writer;
            private string _face;
            private string _title;
            private string _content;
            private DateTime _writeDate;
            private string _reply;
            private DateTime _replyDate;        public Message(int _id, string _writer, string _face, string _title, string _content, DateTime _writeDate, string _reply, DateTime _replyDate)
            {
                this._id = _id;
                this._writer = _writer;
                this._face = _face;
                this._title = _title;
                
                this._content = _content;
                this._writeDate = _writeDate;
                this._reply = _reply;
                this._replyDate = _replyDate;
            }
            public int Id
            {
                get { return _id; }
            }
            public string Writer
            {
                get { return _writer; }
            }
            public string Face
            {
                get { return _face; }
            }
            public string Title
            {
                get { return _title; } 
            }
            public string Content
            {
                get { return _content; }
            }
            public DateTime WriteDate
            {
                get { return _writeDate; }
            }
            public string Reply
            {
                get { return _reply; }
            }        public DateTime ReplyDate
            {
                get { return _replyDate; }
            }    }
    }
    DAL 层:
     public override List<Message> GetMessage(int pageIndex, int pageSize, out int totalRecords)
            {
                if (pageIndex < 0)
                    throw new ArgumentException("PageIndex cannot be negative");
                if (pageSize < 1)
                    throw new ArgumentException("PageSize must be positive");            long lBound = (long)pageIndex * pageSize;
                long uBound = lBound + pageSize - 1;            if (uBound > System.Int32.MaxValue)
                {
                    throw new ArgumentException("PageIndex too big");
                }            List<Message> messageCollection = new List<Message>();            AccessConnectionHolder holder = AccessHelper.GetConnection(_databaseFileName, true);
                OleDbConnection connection = holder.Connection;
                OleDbDataReader reader = null;
                long recordCount = 0;
                try
                {
                    try
                    {
                        OleDbCommand command = new OleDbCommand(@"SELECT Id,Writer,Face,Title,Content,WriteDate,Reply,ReplyDate " +
                                                                @"FROM aspnet_Guestbook ORDER BY Id DESC",
                                                                connection);                    reader = command.ExecuteReader(CommandBehavior.SequentialAccess);
                        while (reader.Read())
                        {                        recordCount++;
                            if (recordCount - 1 < lBound || recordCount - 1 > uBound)
                                continue;
                            Message m = new Message(reader.GetInt32(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(4), reader.GetDateTime(5), reader.GetString(6), reader.GetDateTime(7));                        messageCollection.Add(m);
                        }                    totalRecords = (int)recordCount;
                        return messageCollection;
                    }
                    catch (Exception e)
                    {
                        throw AccessHelper.GetBetterException(e, holder);
                    }
                    finally
                    {
                        if (reader != null)
                            reader.Close();
                        holder.Close();
                    }
                }
                catch
                {
                    throw;
                }
                        }
      

  7.   

    get_messages.aspx
    -----------------------------
    public partial class data_get_messages : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           
            string callBack =Request.QueryString["callback"];
            int pageIndex = Convert.ToInt32(Request.QueryString["start"]);
            int pageSize = Convert.ToInt32(Request.QueryString["limit"]);
            pageIndex = pageIndex / pageSize;
            int totalRecords=0;
     
            List<Message> messageCollection = Addtoo.GetMessage(pageIndex, pageSize, out totalRecords);
            StringBuilder sb = new StringBuilder();
            sb.Append(callBack + "({\"totalCount\":\"" + totalRecords.ToString() + "\",\"messages\":[");
            foreach (Message message in messageCollection)
            {
              
                string msg = ReplaceString(message.Content);
                string reply = ReplaceString(message.Reply);
                sb.Append("{\"message_id\":\"" + message.Id.ToString() + "\",\"message_title\":\"" + message.Title + "\",\"message_author\":\"" + message.Writer + "\",\"post_time\":\"" + message.WriteDate + "\",\"author_face\":\"" + message.Face + "\",\"message_content\":\"" + msg + "\",\"message_reply\":\""+reply+"\"},");
               
            }
            sb.Remove(sb.Length - 1, 1);
            sb.Append("]})");
            Response.Write(sb);
            Response.End();    }
       
        private string ReplaceString(string s)
        {
            s = s.Replace("\"", "&quot;");
          
            s = s.Replace("\n", "");
            return s;
          
        }
    }sign_guestbook.aspx
    --------------------------
    public partial class data_sign_guestbook : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string writer = Request.Form["name"];
            string face = Request.Form["face"];
            string content = Request.Form["content"];
            if (string.IsNullOrEmpty(writer) || string.IsNullOrEmpty(face) || string.IsNullOrEmpty(content))
            {
                return;
            }
           
                   if (content.Length > 1000)
            {
                return;
            }
            content = Server.HtmlEncode(content);
            content = TextReplace(content);
            if (FavoriteSite.WriteMessage("abc", writer, face, content))
            {            Response.Write("{\"success\":true,\"response\":\"留言成功!\"}");
                Response.End();
                //Cache.Remove("MESSAGE_COLLECTION");
            }
            else
            {
                Response.Write("{\"success\":false,\"response\":\"留言失败!请重试\"}");
                Response.End();
            }    }
        private string TextReplace(string msg)
        {
            if (string.IsNullOrEmpty(msg))
            {
                return ("&nbsp;");
            }
            else
            {
                
                msg = msg.Replace(" ", "&nbsp;");
                msg = msg.Replace("\r", "");
                msg = msg.Replace("\n", "<br/>");
               
                return msg;
            }
        }
    }
      

  8.   

    LZ太强了.
    另外,EXT表现力和侧重点不适合做网站.
      

  9.   

    我有看过ext哦.很牛X.支持一下
      

  10.   

    AJAX效率那么低,有必要全站都用么?用来做点小点缀还可以,很久不用AJAX控件了,都自己手写的
    EXT是个什么框架,惭愧,居然没听过
      

  11.   

    ext确实挺不错的,虽然我也使用JS,但建议不过分使用AJAX,毕竟这东西还不太成熟,写程序可以用,但做项目还是要谨慎点比较好!
      

  12.   

    EXT是不错的框架,不过太庞大了,第一次下载JS文件比较慢!!!
      

  13.   

    http://www.cnblogs.com/Reeezak/category/36394.html 
      

  14.   

    感觉不错 ..  
    顶 ...........能不能共享一份呀。[email protected]
      

  15.   

    EXT方是很方便,但是速度总感觉不快
      

  16.   

    http://www.addtoo.net/Guestbook.aspx
    是你做的吗?如果可以我愿意加入这个团队.
    我的Email: [email protected]