Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Server.Execute - how to get back to calling form
Message
De
16/10/2003 08:28:24
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00839135
Message ID:
00839193
Vues:
18
Thanks Rick

>Generally this is bad practice on the Web - you don't want to do something and come back later, but rather do something in succession...
>
>However, the best thing for you maybe to put your mover into a new window that you load with Java Script. Use Window.Open() to open the window. When you're done you use window.Opener (I think - look it up to be sure) to refer back to the original form and populate the value or values that you needed to update.
>
>Generally though the better approach for such a thing is to have the mover form right on the main form, or alternately use new form and then go step by step through the creation of the values (kind of like a Wizard in Windows forms)...


When you say have the mover form on the main form do you mean have it on the form but initially invisible?
Then when I need it to I can make it visible and make my other controlc invisible?

This could be a very intresting idea if I can manage to convert my Mover form into a user control.











>
>+++ Rick ---
>
>
>>Hello Rick
>>
>>Thanks for your reply
>>
>>I am very new to .net and so some of what I am saying in .net terms may not make much sense, if I describe my problem then could you describe the best way I can achieve what I want.
>>
>>
>>I have a main data entry form.
>>On this form is a textbox that contains a list.
>>This list has to be populated from a specific list of items the user can choose from.
>>
>>How should I go about achieving this.
>>
>>At present I have a button on my main form that launches a form that has 2 list boxes on it allowing the user to Move items from one box to another.
>>
>>My problem is that when I call my Mover form and get my selection I somehow have to get back to my main data entry form which is now gone.
>>
>>I realise I can do all this by saving my Main Forms values to Session and then running my Main form again and restoring from session, but since this would be a big save to session I wondered if there was a better way of doing.
>>
>>
>>Thanks in advance
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform