User Controls and access to members on the calling page.

  • Thread starter Thread starter Marc Jennings
  • Start date Start date
M

Marc Jennings

Hi there,

I have an ASP.NET page that includes the following items.

public string s1;
public string s2;
public string s3;

and a User control called TestForm with three text boxes and one
button.

What I want to happen is this.

1) The user sees the simple form, and completes the textboxes.
2) User presses the button
3) Codebehind from TestForm sets the values of s1, s2 and s3 to the
values in the textboxes.
4) TestForm gets visibility set to hidden.

(There *is* a rason I am doing it this way, even though I know there
are better ways of form handling)

Can it be done? If I try

s1 = TextBox1.Text;

it fails (obvously), because s1 doesn't exist within the user class.
Where in the hierarchy can I set the strings, if I can do it within
the User Control at all?

TIA
 
Back
Top