C
Chris Zopers
Hello,
I have an aspx page with some controls like textboxes on it and a button
to save the entered values.
In the code-behind I declared a public variabele of an object, for
example:
public Person _prs = new Person();
Where Person is a class with some properties, like FirstName and
LastName. The textboxes display the values in this way: Text = '<%#
_prs.FirstName #>' and for another Textbox: Text = '<%# _prs.LastName
#>'
When the user clicks on the save button, the page_load event happens
first, so my public Person is always set to a new Person() again and
therefore I can't use the variable _prs to see the new entered values in
the textboxes.
My question is: how can I bind my textboxes to the properties of the
public variable _prs, so the values that are entered in the textboxes
immediately are updated in the Person object and how can I preserve
these values, so I can use the Person object in the button-save click
event?
Greetings,
Chris
I have an aspx page with some controls like textboxes on it and a button
to save the entered values.
In the code-behind I declared a public variabele of an object, for
example:
public Person _prs = new Person();
Where Person is a class with some properties, like FirstName and
LastName. The textboxes display the values in this way: Text = '<%#
_prs.FirstName #>' and for another Textbox: Text = '<%# _prs.LastName
#>'
When the user clicks on the save button, the page_load event happens
first, so my public Person is always set to a new Person() again and
therefore I can't use the variable _prs to see the new entered values in
the textboxes.
My question is: how can I bind my textboxes to the properties of the
public variable _prs, so the values that are entered in the textboxes
immediately are updated in the Person object and how can I preserve
these values, so I can use the Person object in the button-save click
event?
Greetings,
Chris