Create an instance of one webform on another webform

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hi I have start web form and when the user clicks a button (server.transfer)
they are directed to the second webform. I was wondering if there is a way
to create an instance of the first webform on the second webform? I have a
base webform class that both webforms inherit
webform1 : BaseWebclass
webform2 :BaseWebclass

so I do not think I can just inherit webform1 in webform2
thanks
 
Hello Paul,

What's your requirements? What exactly do u want to get?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


P> Hi I have start web form and when the user clicks a button
P> (server.transfer)
P> they are directed to the second webform. I was wondering if there is
P> a way
P> to create an instance of the first webform on the second webform? I
P> have a
P> base webform class that both webforms inherit
P> webform1 : BaseWebclass
P> webform2 :BaseWebclass
P> so I do not think I can just inherit webform1 in webform2 thanks
P>
 
Hi thanks for the response. I was trying to pass values from one webform to
another and found a method of setting properties on the source webform and
using server.transfer and using the properties on the destination webform to
get the values. This requires creating an instance of the source webform on
the destination webform. I ended up just using the query string where the
parameters are in the URL. Many of the pages inherit from a masterpage class
so probably can not just inherit the source page objects into the destination
page.
 
Hello Paul,

You need to use Crosspage postback feature of asp.net 2.0 http://msdn.microsoft.com/en-us/library/ms178139.aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


P> Hi thanks for the response. I was trying to pass values from one
P> webform to another and found a method of setting properties on the
P> source webform and using server.transfer and using the properties on
P> the destination webform to get the values. This requires creating an
P> instance of the source webform on the destination webform. I ended
P> up just using the query string where the parameters are in the URL.
P> Many of the pages inherit from a masterpage class so probably can not
P> just inherit the source page objects into the destination page.
P>
P> "Michael Nemtsev [MVP]" wrote:
P>
Hello Paul,

What's your requirements? What exactly do u want to get?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo

P> Hi I have start web form and when the user clicks a button
P> (server.transfer)
P> they are directed to the second webform. I was wondering if there
is
P> a way
P> to create an instance of the first webform on the second webform?
I
P> have a
P> base webform class that both webforms inherit
P> webform1 : BaseWebclass
P> webform2 :BaseWebclass
P> so I do not think I can just inherit webform1 in webform2 thanks
P>
 
thanks will give it a try. The post back (to the new page) is conditional
but this should not cause any complications.
--
Paul G
Software engineer.


Michael Nemtsev said:
Hello Paul,

You need to use Crosspage postback feature of asp.net 2.0 http://msdn.microsoft.com/en-us/library/ms178139.aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


P> Hi thanks for the response. I was trying to pass values from one
P> webform to another and found a method of setting properties on the
P> source webform and using server.transfer and using the properties on
P> the destination webform to get the values. This requires creating an
P> instance of the source webform on the destination webform. I ended
P> up just using the query string where the parameters are in the URL.
P> Many of the pages inherit from a masterpage class so probably can not
P> just inherit the source page objects into the destination page.
P>
P> "Michael Nemtsev [MVP]" wrote:
P>
Hello Paul,

What's your requirements? What exactly do u want to get?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo

P> Hi I have start web form and when the user clicks a button
P> (server.transfer)
P> they are directed to the second webform. I was wondering if there
is
P> a way
P> to create an instance of the first webform on the second webform?
I
P> have a
P> base webform class that both webforms inherit
P> webform1 : BaseWebclass
P> webform2 :BaseWebclass
P> so I do not think I can just inherit webform1 in webform2 thanks
P>
 
thanks for the information, was able to get it to work. Still have one minor
problem as I have a dropdown list and button on the source page and only want
selecting the button to post to the new page if the dropdown list box on the
source page selected index is not set to 0. I am thinking a custom validator
for the button with the selected control being the dropdown list box may work
but not sure what to use for the client side script.
--
Paul G
Software engineer.


Michael Nemtsev said:
Hello Paul,

You need to use Crosspage postback feature of asp.net 2.0 http://msdn.microsoft.com/en-us/library/ms178139.aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


P> Hi thanks for the response. I was trying to pass values from one
P> webform to another and found a method of setting properties on the
P> source webform and using server.transfer and using the properties on
P> the destination webform to get the values. This requires creating an
P> instance of the source webform on the destination webform. I ended
P> up just using the query string where the parameters are in the URL.
P> Many of the pages inherit from a masterpage class so probably can not
P> just inherit the source page objects into the destination page.
P>
P> "Michael Nemtsev [MVP]" wrote:
P>
Hello Paul,

What's your requirements? What exactly do u want to get?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo

P> Hi I have start web form and when the user clicks a button
P> (server.transfer)
P> they are directed to the second webform. I was wondering if there
is
P> a way
P> to create an instance of the first webform on the second webform?
I
P> have a
P> base webform class that both webforms inherit
P> webform1 : BaseWebclass
P> webform2 :BaseWebclass
P> so I do not think I can just inherit webform1 in webform2 thanks
P>
 
Back
Top