Question about Session
-
Hi all, txt_name.Text = (string)Session["Product_Name"]; if is a integer. . . . How do i type it? txt_number.Text = Thank You
-
Hi all, txt_name.Text = (string)Session["Product_Name"]; if is a integer. . . . How do i type it? txt_number.Text = Thank You
it is in string form you can do anything with it {maybe Session["Product_Name"]=null}
modified on Saturday, January 30, 2010 4:51 AM
-
Hi all, txt_name.Text = (string)Session["Product_Name"]; if is a integer. . . . How do i type it? txt_number.Text = Thank You
You can type it like that:
txt_number.Text = Session["Product_Number"].ToString();
-
You can type it like that:
txt_number.Text = Session["Product_Number"].ToString();
it state: Object reference not set to an instance of an object.
-
it state: Object reference not set to an instance of an object.
YiXiang_89 wrote:
it state: Object reference not set to an instance of an object.
For my first answer i asumed that you have already added a Session variable of type
int
with nameProduct_Number
. The point is that you can useToString()
method to get a string representation of your variable which is a numeric type. Here is a full example:Session["Product_Number"] = 555; //Store
//....
string s = Session["Product_Number"].ToString(); //Retrieve