protected void Page_Load(object sender, EventArgs e) { page_result.InnerHtml = ""; string searchkey = ""; string query = "select * from page"; if (searchkey != "") { query += " WHERE pageid like '%" + searchkey + "%' "; query += " or pagetitle like '%" + searchkey + "%' "; query += " or pagebody like '%" + searchkey + "%' "; } // sql_debugger.InnerHtml = query; var db = new pageDB(); List <Dictionary <String, String> > rs = db.List_Query(query); foreach (Dictionary <String, String> row in rs) { page_result.InnerHtml += "<div class=\"listitem\">"; string pageid = row["pageid"]; string pagetitle = row["pagetitle"]; page_result.InnerHtml += "<div class=\"col4\"><a href=\"ViewPage.aspx?pageid=" + pageid + "\">" + pagetitle + "</a></div>"; string pagebody = row["pagebody"]; page_result.InnerHtml += "<div class=\"col4\">" + pagebody + "</div>"; page_result.InnerHtml += "</div>"; /* page_list.InnerHtml += "<a href=\"ViewPage.aspx?pageid=" + pageid + "\">" + pagetitle + "</a>";*/ // i have commented this code because i have used usercontroller } }
protected void ListOfNavbarLinks(pageDB db) { //query the most popular classes (most students) string query = "select * from page"; List <Dictionary <String, String> > rs = db.List_Query(query); foreach (Dictionary <String, String> row in rs) { string pageid = row["pageid"]; string pagetitle = row["pagetitle"]; nav.InnerHtml += "</div>"; nav.InnerHtml += "<a href=\"ViewPage.aspx?pageid=" + pageid + "\">" + pagetitle + "</a>"; } }