Textbox in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CsharpNoob
    New Member
    • May 2007
    • 9

    #1

    Textbox in C#

    I am trying to write code that pulls up an aspx page displaying a textbox and a button. I want text that is placed in the text box to be displayed on a new page that gets opened when the button is clicked.
    I'm a programming noob.. a C# noob.. and i'm lost... any help is appreciated..
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Originally posted by CsharpNoob
    I am trying to write code that pulls up an aspx page displaying a textbox and a button. I want text that is placed in the text box to be displayed on a new page that gets opened when the button is clicked.
    I'm a programming noob.. a C# noob.. and i'm lost... any help is appreciated..
    Everyone has to start somewhere :)
    Check out the .NET Article on Sessions-How to pass information between forms

    Hope it helps!

    -Frinny

    Comment

    • CsharpNoob
      New Member
      • May 2007
      • 9

      #3
      I viewed your link and it proved to be pretty helpful, but I think the code that you used is for VB and it's showing up as many errors when I copied and pasted it and filled in my variables. I am using ASP.NET web application template in the C# web environment. any suggestions?

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by CsharpNoob
        I viewed your link and it proved to be pretty helpful, but I think the code that you used is for VB and it's showing up as many errors when I copied and pasted it and filled in my variables. I am using ASP.NET web application template in the C# web environment. any suggestions?

        Something like
        On the first page:
        Code:
            private void btn_button1_Click(object sender, System.EventArgs e) {
                Session["userName"] = txt_userName.Text;
                Server.Transfer("secondPage.aspx");
            }
        On the second page:
        Code:
            private void Page_Load(object sender, System.EventArgs e) {
                string userName = Session["userName"];
                lbl_welcome.Text = ("Welcome to working with Sessions " 
                            +  userName + "!");
            }

        I might be wrong.

        -Frinny

        Comment

        • CsharpNoob
          New Member
          • May 2007
          • 9

          #5
          wow thanks. I think that I can work with that. I can't compile due to some technical reasons right now So I can't see if that's 100% effective but I feel that I can at least troubleshoot from there. Thank you VERY much.

          Comment

          Working...