asp.net的查询问题

来源:百度知道 编辑:UC知道 时间:2024/06/08 05:42:44
我想做一新闻发布类的网站,在首页上有一查询新闻的,有三个dropdownlist和三个radiobuttonlist的条件,请问下代码应该怎么写???
最好给个类似的例子,要不讲下大概怎么写也行!
急啊~~
谢谢了!!

gjz = Request.Form["txt_gjz"].ToString();
type = ddl_type.SelectedValue;

<input name="txt_gjz" type="text" value="输入关键词" size="19"/>
<asp:DropDownList ID="ddl_type" runat="server" Width ="140">
<asp:ListItem>文章关键字</asp:ListItem>
<asp:ListItem>文章标题</asp:ListItem>
<asp:ListItem>文章作者</asp:ListItem>
<asp:ListItem>文章摘要</asp:ListItem>
</asp:DropDownList>

if (gjz != "" && gjz != "输入关键词")
{
if (type == "文章关键字")
{
_sqlgjz = " new_content like '%" + gjz + "%'";