Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Server.Execute - how to get back to calling form
Message
 
À
16/10/2003 02:38:47
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00839135
Message ID:
00839143
Vues:
20
Server.Execute is meant to pass control to another page and return the output. You can let it render on its but when you do the output it generates goes directly into your output.

Here's the example from the help file:
StringWriter writer = new StringWriter();
Server.Execute("Login.aspx", writer);
Response.Write("<H3>Please Login:</H3><br>"+ writer.ToString());
that demonstrates this process

What you want to do is pass in a TextWriter object, let the other page run and render its HTML and return the TextWriter with the Captured HTML. Whether this works for you really depends on what you need to accomplish.

If you really need to transfer to another page and let it do its thing INSTEAD of the current page then you should use Server.Transfer() or Response.Redirect(). Server.Transfer leaves you in the current Request context while Response.Redirect completely gets out and back in from the client.




>I am wrting a web application using vb code behind.
>
>I have a utility form (it a data Mover type utility) that I need to call from my main data entry web form.
>My current understanding is that when I call my mover form I will lose my existing form so I will have to save all my text boxes out to session.
>
>The Server.Execute method allows the current ASPX page to execute a specified ASPX page on the same web server. After the specified ASPX page is executed, the control transfers back to the original page from which the Server.Execute method was called.
>
>This would be very useful way for my mover form to work since it would avoid me having to do a large save to session prior to launching my mover form.
>
>However my first attempt to get this working just overlayed the controls from my mover form onto my display form instead of first clearing my form. This was not the desired effect.
>In Addition I can not find out how to make my main display form regain its normal appearence.
>
>What am I doing wrong in all this.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform