<body>
<center>
<form action="index.aspx" method="post" runat="server" ID="Form1">
<h3>
姓名:<asp:textbox id="Name" runat="server" />
类别:<asp:dropdownlist id="Category" runat="server">
<asp:listitem>四川</asp:listitem>
<asp:listitem>江苏</asp:listitem>
<asp:listitem>陕西</asp:listitem>
</asp:dropdownlist>
</h3>
<asp:button text="查找" runat="server" id="Button1" />
<asp:datalist id="MyList" layout="flow" showfooter="true" borderwidth="0" runat="server">
<HeaderTemplate>
<table cellpadding="1" cellspacing="0">
<tr>
<td>姓名</td>
<td>内线</td>
<td>手机</td>
</tr>
<tr>
<td colspan="5" height="5" bgcolor="000000"></td>
</tr>
</HeaderTemplate>
<FooterTemplate>
<tr>
<td colspan="5" height="5" bgcolor="000000"></td>
</tr>
</table>
</FooterTemplate>
<ItemTemplate>
<tr>
<td style="font-size:10.5pt">
<b>
<%# DataBinder.Eval(Container.DataItem, "users") %>
</b>
</td>
<td bgcolor="#66cc00">
<b>
<%# DataBinder.Eval(Container.DataItem, "outline") %>
</b>
</td>
<td align="right" style="font-size:10.5pt">
<b>
<%# DataBinder.Eval(Container.DataItem, "moveline") %>
</b>
</td>
</tr>
</ItemTemplate>
<SeparatorTemplate>
<tr>
<td colspan="5" height="1" bgcolor="000000"></td>
</tr>
</SeparatorTemplate>
</asp:datalist>
</form>
</center>
<P></P>
</body>
<center>
<form action="index.aspx" method="post" runat="server" ID="Form1">
<h3>
姓名:<asp:textbox id="Name" runat="server" />
类别:<asp:dropdownlist id="Category" runat="server">
<asp:listitem>四川</asp:listitem>
<asp:listitem>江苏</asp:listitem>
<asp:listitem>陕西</asp:listitem>
</asp:dropdownlist>
</h3>
<asp:button text="查找" runat="server" id="Button1" />
<asp:datalist id="MyList" layout="flow" showfooter="true" borderwidth="0" runat="server">
<HeaderTemplate>
<table cellpadding="1" cellspacing="0">
<tr>
<td>姓名</td>
<td>内线</td>
<td>手机</td>
</tr>
<tr>
<td colspan="5" height="5" bgcolor="000000"></td>
</tr>
</HeaderTemplate>
<FooterTemplate>
<tr>
<td colspan="5" height="5" bgcolor="000000"></td>
</tr>
</table>
</FooterTemplate>
<ItemTemplate>
<tr>
<td style="font-size:10.5pt">
<b>
<%# DataBinder.Eval(Container.DataItem, "users") %>
</b>
</td>
<td bgcolor="#66cc00">
<b>
<%# DataBinder.Eval(Container.DataItem, "outline") %>
</b>
</td>
<td align="right" style="font-size:10.5pt">
<b>
<%# DataBinder.Eval(Container.DataItem, "moveline") %>
</b>
</td>
</tr>
</ItemTemplate>
<SeparatorTemplate>
<tr>
<td colspan="5" height="1" bgcolor="000000"></td>
</tr>
</SeparatorTemplate>
</asp:datalist>
</form>
</center>
<P></P>
</body>
解决方案 »
- 网站运行过程中出现如下错误
- 一般做开发会用验证控件吗?
- 高分求Application Warm-Up Beta这个module下载,分在另一个帖子。
- 一个页面有dropdownlist 和一个新建按钮,当点新建时,弹出对话框
- 我实在没办法了,真的,求助高手提供vs2005用C#编的一些好例子吧,谢谢了。
- Microsoft Application Center Test 这个.NET自带的测试工具怎么个用法?
- 高分请教:请问如何导入广联达格式的数据到我的SQL Server
- 满分重赏高手:关于网页读取所有文件问题===》》
- 急问我怎么把一个%2003%之类的字符从一个页面传到另一个页面
- __doPostBack问题,紧急求助!!!
- 请高手帮忙?错在那里
- 我想写一个对XML文件的分页显示程序,怎么才能每次从XML文件中加载一页的数据???
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;namespace sigt_N01
{
/// <summary>
/// index 的摘要说明。
/// </summary>
public class index : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox Name;
protected System.Web.UI.WebControls.DropDownList Category;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.DataList MyList;
protected System.Web.UI.HtmlControls.HtmlForm Form1;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
} #region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.MyList.SelectedIndexChanged += new System.EventHandler(this.MyList_SelectedIndexChanged);
this.Load += new System.EventHandler(this.Page_Load); }
#endregion private void button1_Click(object sender, System.EventArgs e)
{
string Name,pwd
Name=Name.Text;
SqlConnection myConnection = new SqlConnection("server=itsigt;uid=sa;pwd=123;database=phone");
SqlDataAdapter myCommand = new SqlDataAdapter("select * from phonemain where users like '"+ Name +"'", myConnection); DataSet ds = new DataSet();
myCommand.Fill(ds, "phonemain"); MyList.DataSource = ds.Tables["phonemain"].DefaultView;
MyList.DataBind();
}
}
}
多谢各位大侠!!! 参数怎么传到后面的代码页中!!!!!
{
// 在此处放置用户代码以初始化页面
}
放在这里面
Name=Name.Text;
response.write(name.text)
测试在这里response.write(name.text)试试能不能出来你输入的值
Name=Name.Text;
response.write(name.text)
这样命名vsnet不能通过编译的.这么写
string na;
na=Name.Text;
Response.write(na.Text);
应该没有问题的
string Name,pwd
Name=Name.Text;
response.write(name.text)
这样命名vsnet不能通过编译的.这么写
string na;
na=Name.Text;
Response.write(na);
应该没有问题的