Open a webform

  • Thread starter Thread starter Ivan Sammut
  • Start date Start date
I

Ivan Sammut

Hi,

I have 2 webform Webform1 & WebForm2

In Webform1 I have a button that when I click I want to first set a variable
in WebForm2 & then open the Page.

This is the code I have now which sets the variable but I cannot figure out
how to make the page load

Webform2 frm = new WebForm2();
frm.var1 = "####";

Now how do I make the Form load;

Thanks,
Ivan Sammut
 
If your form name is Frm1, then try

Frm1.Show(); //non modal

or

Frm1.ShowDialog(); //modal
 
Ivan said:
Hi,

I have 2 webform Webform1 & WebForm2

In Webform1 I have a button that when I click I want to first set a variable
in WebForm2 & then open the Page.

This is the code I have now which sets the variable but I cannot figure out
how to make the page load

Webform2 frm = new WebForm2();
frm.var1 = "####";

Now how do I make the Form load;

Thanks,
Ivan Sammut
Ivan,
What you need is to use the Server.Transfer method. In the second
page you can get the 'Handler' which really is webform1. So all you need
to do is to cast it as a webform1 (with check ofcourse, to see if it
really is webform1!) and get all the properties that you need.
Hope that helps
 
Hi,

Can you please give me a small example. I'm still a rookie and half of what
you said does not make sense.

Thanks
Ivan Sammut
 
Back
Top