Hey guys..
Have started developing my first web application in c#.I want to know how can we pass value of a label on one form to a label on another form
say Form1 label1 has a text "xyz"
i need this value on form2 label1
Hey guys..
Have started developing my first web application in c#.I want to know how can we pass value of a label on one form to a label on another form
say Form1 label1 has a text "xyz"
i need this value on form2 label1
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dinesh BeniwalPosted Mar 25, 2009, 5:18 AM
Vipul KelkarPosted Mar 5, 2009, 4:41 AM
I am not able to pass an array and integer through sessions.I have done it as given below
FOR INTEGER
Session["Count"] = cnt;
int count = Session["Count"] //to recieve on 2nd form
FOR ARRAY
Session["Arr"] = arry // arry is a String Array
String [] arry = Session["Arr"];
Please help me out
Vipul KelkarPosted Mar 5, 2009, 4:01 AM
Vimal KandasamyPosted Mar 5, 2009, 3:06 AM
yes, you can pass more than one value by seperate them with & symbol;
for session use the following,
Session["Name"]="value"
Response.Redirect("newpage.aspx");
in the next page u have to receive it by using the code
String name=Session["Name"].ToString();
Vipul KelkarPosted Mar 5, 2009, 2:59 AM
It works with query string.
But can i get a sample code for doin it with Session.I havent worked with session yet
for query string i used this
Response.redirect("form.aspx?Value1"=textbox1.text);
Can we pass more that one value here ???
Thanks
Rahul Kumar SaxenaPosted Mar 5, 2009, 2:29 AM