Open a webform

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
 
B

Ben Rush

If your form name is Frm1, then try

Frm1.Show(); //non modal

or

Frm1.ShowDialog(); //modal
 
D

Dilip Krishnan

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
 
I

Ivan Sammut

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top