Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,725
    Thanks
    41
    Thanked 191 Times in 190 Posts

    pass without reloading

    So I am still sorta new to the C# aspect of asp.net...
    on page load i have the following

    asp:
    label w/ id lbl_Name
    textbox w/ id txt_fName
    textbox w/ id txt_disp

    and a button

    Code:
    protected void Page_Load(object sender, EventArgs e){
    lbl_Name.Text="Name:";
    txt_fName.Text="First Name";
    txt_disp.Text="";
    }
    
    protected void Button1_Click(object sender, EventArgs e){
    string fName= this.txt_fName.Text;
    this.txt_disp.Text= fName;
    }
    now when i click the button (after entering some name in like "bob")
    it does not display "bob" it displays "First Name"

    I know this is basic, but as i said i am newer to this and trying to get a handle on it

    Edit Notes: I still do not know why this is happening, but it was a work around until I had my database set up to pass info to. I don't really need this answered, but if you stumble across it and know the answer I would appreciate a PM explanation.
    Last edited by alykins; 05-28-2011 at 04:49 AM.

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •