Returning a value from textbox in a class

Total Post:135

C#  ASP.Net 
 1242  View(s)
Rate this:

I have a text box in my form. I have a class TicketUser where i have accessors set to return a a value in my label. Im trying to get the value from the text box inside the label. I'm trying to get firstName to return a value of txtfirstName.Text from my form. Can someone please guide me in the right direction please. Im pretty new to 

public class TicketUser
    public string firstName;
    public string lastName;
    public string username;
    TicketForm form = new TicketForm();
    //property accessors
  public string CreateAccountMessage
            return "Congratulations" + firstName + "Your account has been created. Your username is" + username;
            CreateAccountMessage = value;
    //CreateAccount method
    public string CreateAccount()
        return CreateAccountMessage;

  1. Post:108

    Re: Returning a value from textbox in a class

    I hope i got you correct because you need to some details about what you are trying to do and what are the results. Make and Object of TicketUser in the code behind file of the form and set


    t = new TicketUser();




  1. Post:412

    Re: Returning a value from textbox in a class

    Change this: 

    public string firstName = "";

    public string lastName = "";

    public string username = "";

      Modified On Apr-07-2018 05:11:23 AM