Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

display data from one page to another

Question posted by: Bubbles (Newbie) on July 25th, 2008 11:36 AM
i have created a login screen that validates the username and password provided by the user. now i want that after validation the screen that apears should contain the validated user name in one corner, as even this site has.
but how should i go about it?
r035198x's Avatar
r035198x
Administrator
10,754 Posts
July 25th, 2008
11:44 AM
#2

Re: display data from one page to another
There are several methods. Read about them from here.

Reply
Bubbles's Avatar
Bubbles
Newbie
8 Posts
July 26th, 2008
10:52 AM
#3

Re: display data from one page to another
Quote:
There are several methods. Read about them from here.


thanx!
i went thru the link.
The case relevent to me is to get the values of controls from the source page in the same application, so tried the following code:

Expand|Select|Wrap|Line Numbers
  1. protected void Page_Load(object sender, EventArgs e)
  2.     {
  3.         if (Page.PreviousPage != null)
  4.         {
  5.             TextBox SourceTextBox =
  6.                 (TextBox)Page.PreviousPage.FindControl("UserNameTextbox");
  7.             if (SourceTextBox != null)
  8.             {
  9.                 usernameLabel.Text = SourceTextBox.Text;
  10.             }
  11.         }

But it doesn't work. What am i doing wrong?

Reply
vinot85's Avatar
vinot85
Member
40 Posts
July 26th, 2008
01:44 PM
#4

Re: display data from one page to another
Hey buddy,
It is very simple to send an information from one form to other web form.
You can either use Query strings or Sessions

Reply
Reply
Not the answer you were looking for? Post your question . . .
189,758 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top .NET Forum Contributors