请教一个小问题,解决了立即给分
<form name= "order " action= "shopcart.aspx " onsubmit= "AddToCart(this); ">
<input id= "Hidden1 " type= "hidden " name= "QUANTITY " value= "1 ">
<input type= "image " src= "../images/buynow.gif " align= "top ">
<input id= "Hidden2 " type= "hidden " name= "PRICE " value= ' <%=menuVintagePrice%> ' runat= "server ">
<input id= "Hidden3 " type= "hidden " name= "NAME " value= ' <%=menuVintageName%> ' runat= "server ">
<input id= "Hidden4 " type= "hidden " name= "ID_NUM " value= ' <%=menuVintageId%> ' runat= "server ">
</form>
private void BindInput()
{
string connectionString = ConfigurationManager.AppSettings[ "ConnectionString "];
using (SqlConnection sqlconn = new SqlConnection(connectionString))
{
sqlconn.Open();
string strComm = "SELECT MenuVintageId,MenuVintageName,MenuVintagePrice FROM D_Menu_Vintage ";
SqlCommand command= new SqlCommand(strComm,sqlconn);
SqlDataReader dr = command.ExecuteReader();
if (dr.Read())
{
menuVintageId = Convert.ToInt32(dr[ "MenuVintageId "]);
menuVintageName = dr[ "MenuVintageName "].ToString();
menuVintagePrice = float.Parse(dr[ "MenuVintagePrice "].ToString());
}
}
}
显示的结果不是我想要的数值。而是 <%=menuVintagePrice%> <%=menuVintageName%>