CS0103: 当前上下文中不存在名称
[bo]表单代码:[/bo]<li>
<asp:DropDownList ID="dw_flmc" runat="server" DataSourceID="AccessDataSource3" DataTextField="flmc" DataValueField="flid" Width="149px"></asp:DropDownList>
<asp:AccessDataSource ID="AccessDataSource3" runat="server" DataFile="~/database/tianhao.mdb" SelectCommand="SELECT * FROM [cpfl]"></asp:AccessDataSource>
</li>
<li>
<asp:DropDownList ID="dw_ppmc" runat="server" DataSourceID="AccessDataSource4" DataTextField="ppmc" DataValueField="ppid" Width="145px"></asp:DropDownList>
<asp:AccessDataSource ID="AccessDataSource4" runat="server" DataFile="~/database/tianhao.mdb" SelectCommand="SELECT * FROM [cppp]"></asp:AccessDataSource>
</li>
<li>
<asp:TextBox ID="tb_cpmc" runat="server" Width="87px"></asp:TextBox><asp:Button ID="bt_ss" runat="server" Text="搜 索" OnClick="bt_ss_Click" />
</li>
bt_ss_Click的OnClick 事件:
protected void bt_ss_Click(object sender, EventArgs e)
{
string flid = dw_flmc.SelectedValue.ToString().Trim();
string ppid = dw_ppmc.SelectedValue.ToString().Trim();
string cpmc = tb_cpmc.Text.ToString().Trim();
Response.Redirect("sscp.aspx?flid="+flid+"&ppid="+ppid+"&cpmc="+cpmc);
}
[bo]错误提示:[/bo]
编译器错误信息: CS0103: 当前上下文中不存在名称“dw_flmc”
源错误:
行 21: {
行 22:
行 23: string flid = dw_flmc.SelectedValue.ToString().Trim();
行 24: string ppid = dw_ppmc.SelectedValue.ToString().Trim();
行 25: string cpmc = tb_cpmc.Text.ToString().Trim();
请大侠帮忙。谢谢!!!!!