日期:2014-05-18 浏览次数:20797 次
<p> <a href="#"> <asp:LinkButton ID="equipment" runat="server" CommandName="设备介绍" OnCommand="search_Click" >设备介绍</asp:LinkButton></a></p> <p> <a href="#"><asp:LinkButton ID="web" runat="server" CommandName="WEB组" OnCommand="search_Click" >WEB组</asp:LinkButton></a></p> <p> <a href="#"><asp:LinkButton ID="xitong" runat="server" CommandName="系统开发组" OnCommand="search_Click" >系统开发组</asp:LinkButton></a></p> <p> <a href="#"><asp:LinkButton ID="ps" runat="server" CommandName="美工" OnCommand="search_Click" >美工</asp:LinkButton></a></p> <p> <a href="#"><asp:LinkButton ID="contaction" runat="server" CommandName="联系人" OnCommand="search_Click" >联系人</asp:LinkButton></a></p> 后台代码: protected void search_Click(object sender, CommandEventArgs e) { string search = e.CommandName.ToString(); string strwhere = "select content from apply where title='" + search + "' "; DataSet ds = gwolf_bll.GetMessage(strwhere); content.Text = ds.Tables[0].Rows[0][0].ToString(); } public static DataSet GetMessage(string SQLstring) { return gwolf_dal.Search(SQLstring); } public static DataSet Search(string SQLstring) { ConOpen(); try { Command = new MySqlDataAdapter(SQLstring, Sqlcon); Command.Fill(myds, "chaxun"); Command.Dispose(); } catch(Exception) { throw; } finally { ConClose(); } return myds; }