在客户端:
<script type="text/javascript">
function ShowDetailPopup(FPS_Code, PhaseNo) {
popup.SetContentUrl("test4.aspx?id=" + FPS_Code + "&PhaseNo=" + PhaseNo);
popup.Show();
}
</script>
在服务器端:
using (SqlConnection con = new SqlConnection(strcon1))
{
SqlCommand cmd = new SqlCommand("SELECT ID,DocumentNo,ReleaseNo,PhaseNo,FPS_Code,DrawingNo FROM Project1 WHERE FPS_Code=@FPS_Code and PhaseNo=@PhaseNo");
cmd.Parameters.AddWithValue("@FPS_Code", Request.QueryString["id"].ToString());
cmd.Parameters.AddWithValue("@PhaseNo", Request.QueryString["PhaseNo"]);
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
con.Open();
SqlDataReader sdr = cmd.ExecuteReader();
while (sdr.Read())
{
ASPxLabel1.Text = sdr["ID"].ToString();
ASPxLabel2.Text = sdr["ReleaseNo"].ToString();
ASPxLabel3.Text = sdr["PhaseNo"].ToString();
ASPxLabel4.Text = sdr["DrawingNo"].ToString();
ASPxLabel5.Text = sdr["FPS_Code"].ToString();
}
con.Close();
}
3条答案
按热度按时间r9f1avp51#
向
SqlCommand
添加参数时,可以指定Float
数据类型,如下所示:yqkkidmi2#
只需使用URL转义如下:
7dl7o3gd3#
必须将PhaseNo字符串转换为双精度。将该行
与