protected void Page_Load(object sender, EventArgs e) { string keyword = Request["k"]; string Mode = Request["Mode"]; string ReturnTextbox = Request["TB"]; string MyDiv = Request["MyDiv"]; if (keyword != null && Mode != null && keyword.Trim().Length > 0) { string sql = ""; if (Mode == "uid") { sql = "SELECT Distinct TOP 5 uid FROM tbuser ORDER BY uid"; } else { return; } DataSet ds = new DataSet(); SqlConnection conn = new SqlConnection(); conn = new SqlConnection(ConfigurationManager.ConnectionStrings["kuviConnectionString"].ConnectionString); SqlDataAdapter adapter = new SqlDataAdapter(sql, conn); adapter.Fill(ds); if (ds != null && ds.Tables.Count > 0) { DataTable dt = new DataTable(); dt = ds.Tables[0]; foreach (DataRow row in dt.Rows) { string mydata = row[0].ToString(); if (ReturnTextbox != null && ReturnTextbox.Trim().Length > 0) { //Write to default page, with selection options. if (MyDiv == null || MyDiv.Trim().Length == 0) { Response.Write("<div önmouseover="\" this.style.cursor="pointer" pointer=" mode=" hold=" /> " önclick="\" mydata="" mydiv=""><font size="2" face="Tahoma">" + mydata + "</font>" + ""); } } else { Response.Write("<div><font size="2" face="Tahoma">" + mydata + "</font></div>"); } } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)