.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

display text in other page using c#

Posted By: Rama Krishna     Posted Date: August 13, 2009    Points:2   Category :C#
in c#.net
in first page i took
lable-- textbox
lable-- textbox
lable-- textbox

in second page i took
lable
lable
lable

my requiement is the text enterd in text boxes in first page will display in lables in second page
i want some guidlines for code

Responses
Author: Praveen             
Posted Date: August 13, 2009     Points: 5   

hi,
Two way i can suggest to pass value from one page to another in asp.net

1) using Request Object for eg

in your 2nd page

Label1.Text = Request["TextBox1"];

2) Using Session Variable

Take one arraylist than add the value into it in 1st page like this


ArrayList arr = new ArrayList();
arr.Add(TextBox1.Text);
arr.Add(TextBox2.Text);
arr.Add(TextBox3.Text);

//Assign this arraylist to session variable

Session["ValueToPass"] = arr;

Now in the second page


ArrayList arr = (ArrayList) Session["ValueToPass"]
if(arr !=null)
{
Label1.text = arr[0];
Label2.text = arr[1];
Label3.text = arr[1];
}


there are other ways also



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend