forum

Home / DeveloperSection / Forums / Returning a value from textbox in a class

Returning a value from textbox in a class

Anonymous User 1801 18-Dec-2014

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 asp.net 

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


Updated on 19-Dec-2014
I am a content writter !

Can you answer this question?


Answer

2 Answers

Liked By