为什么传递内容不变
我用了一个droplist想根据这个里面的内容打开页面,可是不管我选哪个,里面的内容总是原来那个 <%@ Page Language= "C# "%>
<%@ Import Namespace= "System.Data.OleDb "%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<script runat= "server ">
void Page_Load(Object sender, EventArgs e)
{
OleDbConnection condatabase;
OleDbCommand cmdSelectdatabase;
OleDbDataReader dtrdatabase;
// Retrieve records from database
condatabase = new OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=E:\\powerflow\\loadflow.mdb ");
condatabase.Open();
cmdSelectdatabase = new OleDbCommand( "Select * from main ", condatabase);
dtrdatabase = cmdSelectdatabase.ExecuteReader();
// Bind to dropdownlist
droplist.DataSource = dtrdatabase;
droplist.DataTextField = "TYPE ";
droplist.DataBind();
dtrdatabase.Close();
condatabase.Close();
}
void Search_Click(object sender, System.EventArgs e)
{
OleDbConnection condatabase;
string strSelect;
OleDbCommand cmdSelect;
condatabase = new OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=E:\\powerflow\\loadflow.mdb ");
strSelect = "Select SIGN From main Where TYPE=@type ";
cmdSelect = new OleDbCommand(strSelect, condatabase);
cmdSelect.Parameters.Add( "@type ", droplist.SelectedValue);
condatabase.Open();
if ((int)cmdSelect.ExecuteScalar()!=0)