private void CreateSmileys() { int pgnum = pager.CurrentPageIndex; pager.Count = dtSmileys.Rows.Count; int intpg = pgnum * pagesize; System.Text.StringBuilder html = new System.Text.StringBuilder(); html.AppendFormat("<tr class='post'>"); int rowcells = 0; for (int i = intpg; i < intpg + pagesize; i++) { if (i < dtSmileys.Rows.Count) { DataRow row = dtSmileys.Rows[i]; if (i % perrow == 0 && i > 0 && i < dtSmileys.Rows.Count) { html.Append("</tr><tr class='post'>\n"); rowcells = 0; } string evt = ""; if (_onclick.Length > 0) { string strCode = Convert.ToString(row["Code"]).ToLower(); strCode = strCode.Replace("&", "&"); strCode = strCode.Replace("\"", """); strCode = strCode.Replace("'", "\\'"); evt = String.Format("javascript:{0}('{1} ','{3}images/emoticons/{2}')", _onclick, strCode, row["Icon"], Data.ForumRoot); } else { evt = "javascript:void()"; } html.AppendFormat("<td><a tabindex=\"999\" href=\"{2}\"><img src=\"{0}\" title=\"{1}\"/></a></td>\n", ForumPage.Smiley((string)row["Icon"]), row["Emoticon"], evt); rowcells++; } } while (rowcells++ < perrow) { html.AppendFormat("<td> </td>"); } html.AppendFormat("</tr>"); SmileyResults.Text = html.ToString(); }