Click here to Skip to main content
15,944,733 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a ASP.Net 2.0 web app in VB. I need to copy all relavant data for the current customer shown on the page from a menu action item. Then when the action has completed the copy methods, with a new Unique reference ID, I need to reload the same page with the relavant data of the new unique ID.

For instance,I have a contract for renewal. I open the contract and all the relavant data is diplayed. I select renew contract from a menu item and it calls the mehods to copy all the original data and creates a new unique contract ID. Once the copy is complete, the same page is reloaded with the new uniqueID and newly created data.

I have created all the copy procedures and fire them with the menu item. I am used to using Reponse.Redirect to open another form, but how do you re-open the same form with new information?

What I have come up with so far:
The Page is loaded referencing the session variables, one of which is the contractID.
So I added code after the copy procedure to get the session variable, change it to the new contractID and re-load the page with the new contractID.
VB
WebUserSession.SessionInfoGet()
Session.ContractID = NewContractID
WebUserSession.SessionInfoSet(Session)

Response.Redirect("..\frmContract.aspx")


It works, but I am concerned that this might not be the best way, because now if I want to navigate back to the original contract I will have to change the Session.ContractID back to the original.
Posted
Updated 6-Mar-12 11:59am
v2
Comments
Ganesan Senthilvel 24-Feb-12 20:48pm    
Removed sql tag
Career Web Helper 2-Mar-12 4:22am    
u can use state management to maintain data and use Reponse.Redirect or Server.Transfer with same page name as arg.
..

It would be great, if you share the code for better clarity of the scenario.
 
Share this answer
 
Yes.. please let us see a portion of your codes so that we could verify your problem..
 
Share this answer
 
Comments
Anuja Pawar Indore 2-Mar-12 1:05am    
Post it as a comment....
botskie 2-Mar-12 1:24am    
sorry my mistake :)
This is what I have so far:

VB
Protected Sub MenuNav_MenuItemClick 
  
 Select Case MenuNav.SelectedItem.Text

  ' Menu selection
  Case "Create Renewal" 

 
  'Method to Copy current contract data using ContractID stored in session variable and create a new contract
  CopyContract(mwus.ContractID)

    
  'Method to get newly created ContractID
  Dim ContractID as Integer
  ContractID = GetRenewalID()

  'This is what I have to show the Renewal in a different form.
  Response.Redirect("..\frmRenewal.aspx", False)

'What I need is to show the Renewal in the same form where the create renewal action originated
'Something like this:   
 'Response.Redirect("..\frmContract.aspx", ContractID)
 End Select

End Sub"
 
Share this answer
 
Comments
Anuja Pawar Indore 6-Mar-12 2:49am    
Use improve question link and add your code there. This is answer section
use HTML button type "Submit" , this will make POST in webpage ,so redirect to same page
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900