apply if condition at session
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string s17 = Request.Form["scheck"].ToString();
scheck.Value = s17;
Response.Write(s17);
string s18 = Request.Form["sacc1"].ToString();
sacc1.Value = s18;
Response.Write(s18);
string s19 = Request.Form["schild"].ToString();
schild.Value = s19;
Response.Write(s19);
string s = Session["child"].ToString();
//Response.Write(s);
//Response.Write(s19);int.Parse(Request.Form["schild"])==1
if (int.Parse(s19)== 1)
{
Session["a"] = ctcchild1.name;
Session["b"] = ctcchild1.age;
Session["c"] = ctcchild1.college;
}
else if (int.Parse(s19)==2)
{
Session["d"] = ctcchild2.name;
Session["e"] = ctcchild2.age;
Session["f"] = ctcchild2.college;
}
//else
//{
else if (2<int.Parse(s19) <= 3)(error)
{
Session["g"] = ctcchild3.name;
Session["h"] = ctcchild3.age;
Session["i"] = ctcchild3.college;
}
else if(int.Parse(s19) == 4)
{
Session["j"] = ctcchild4.name;
Session["k"] = ctcchild4.age;
Session["l"] = ctcchild4.college;
}
plz tell me is it possible to apply condition at session .and how it is possible
|