in client side :
<script type="text/javascript">
function ShowDetailPopup(FPS_Code, PhaseNo) {
popup.SetContentUrl("test4.aspx?id=" + FPS_Code + "&PhaseNo=" + PhaseNo);
popup.Show();
}
</script>
in server side:
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
Answers
Just use url escaping as below:
You can specify
Float
data type when adding parameter toSqlCommand
as follows:You must convert the PhaseNo string to double. Replace the line
with