足球史上最无耻的比赛:aso.net webmatrix怎样通过textbox和dropdownlist实现搜索

来源:百度文库 编辑:高考问答 时间:2024/04/26 07:20:01
假设表1有ID,姓,名,出生日期,性别,E-MAIL组成

通过TEXTBOX的输入和DROPDOWNLIST的选择,在BUTTON的事件响应下,输出查找到的所有数据,怎么办?

写了一半,但是实在不知道该怎么写了。

<%@ Page Language="VB" %>
<%@ Register TagPrefix="wmx" Namespace="Microsoft.Saturn.Framework.Web.UI" Assembly="Microsoft.Saturn.Framework, Version=0.5.464.0, Culture=neutral, PublicKeyToken=6f763c9966660626" %>
<script runat="server">

Sub submit(sender As Object, e As EventArgs)
End Sub

Sub drop1_SelectedIndexChanged(sender As Object, e As EventArgs)

End Sub

Sub TextBox1_TextChanged(sender As Object, e As EventArgs)

End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:TextBox id="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged"></asp:TextBox>
<asp:DropDownList id="drop1" runat="server" OnSelectedIndexChanged="drop1_SelectedIndexChanged">
<asp:ListItem>ID</asp:ListItem>
<asp:ListItem>姓</asp:ListItem>
<asp:ListItem>名</asp:ListItem>
<asp:ListItem>性别</asp:ListItem>
<asp:ListItem>出生年月</asp:ListItem>
<asp:ListItem>e_mail</asp:ListItem>
</asp:DropDownList>
<asp:Button id="Button1" onclick="submit" runat="server" Text="Submit"></asp:Button>
<p>
<wmx:SqlDataSourceControl id="SqlDataSourceControl1" runat="server" UpdateCommand="UPDATE [student_daten] SET [matrike_id]=@matrike_id,[name]=@name,[vorname]=@vorname,[geburtsdatum]=@geburtsdatum,[geschlechte]=@geschlechte,[e_mail]=@e_mail WHERE [matrike_id]=@matrike_id" SelectCommand="SELECT * FROM [student_daten]" AutoGenerateUpdateCommand="False" ConnectionString="server='localhost'; trusted_connection=true; Database='student'" DeleteCommand=""></wmx:SqlDataSourceControl>
</p>
</form>
</body>
</html>

哪位帮小弟一把,谢谢!