Subscribe to Subscribers
Talk to Webmaster Tony John

Online Members

Pawan Awasthi
More...


Forums » .NET » ASP.NET »

Accessing controls like label/textbox from one web page to another


Posted Date: 17 Jun 2010      Posted By:: sadanandam     Member Level: Bronze    Member Rank: 1807     Points: 1   Responses: 4



my design contain two web pages page1,page2.page1 contain usename textbox,login button.page2 contain label & logout button.In page1 when I enter "rama" in textbox & click login button then it will open page2 & on page loading label text will be ("Welcome" +TextBox.Text).In page2 when I click logout button it will open page1 webpage.the main problem is label text will not coming on page load of page2.please help me.don't use vb.net code.use C# code.



Responses

#517786    Author: Praveen      Member Level: Gold      Member Rank: 70     Date: 17/Jun/2010   Rating: 2 out of 52 out of 5     Points: 2

Hi,

in Page2 Page_Load event try like this



Label1.Text=((TextBox)Page.PreviousPage.Findcontrol("Page1 TextBox Id here")).Text;



Hope that will help you



 
#517787    Author: k.anantharengan      Member Level: Gold      Member Rank: 709     Date: 17/Jun/2010   Rating: 2 out of 52 out of 5     Points: 2

you can do as praveen suggested or you can use session variables for storing values across the pages.


 
#517798    Author: saravanan      Member Level: Gold      Member Rank: 615     Date: 17/Jun/2010   Rating: 2 out of 52 out of 5     Points: 2

Better you can have the first textbox value in Session then you will show it in next page. this is very simple one!!!

Regards,
Sarav
Check here for More...






 
#517943    Author: sadanandam      Member Level: Bronze      Member Rank: 1807     Date: 18/Jun/2010   Rating: 2 out of 52 out of 5     Points: 2

It is working,thank you.Thank you very much.


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : Barcode printing issue
Previous : Adding a link to a column
Return to Discussion Forum
Post New Message
Category:

Related Messages



Follow us on Twitter: https://twitter.com/dotnetspider

Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.