Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 16th, 2011, 11:24 PM
Authorized User
 
Join Date: Mar 2011
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Default From a page, call another, get some data, pass it back to first page

I have a page of data intered by a user. To complete that page I need to call another page to do a lookup, select a row, then pass the selected row key data back to the original page and continue from there. Now this is probably pretty common activity but I'm still new to the ways of the web (asp.net). Can anyone point me to an example for this? Is there a better way than what I described?

Thanks
 
Old April 17th, 2011, 04:28 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Can you elaborate a bit on what data you need exactly and where / how? From client side code?

I am thinking that ASP.NET Page Methods or Web Services would be a good solution, but it all depends on the actual scenario.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old April 23rd, 2011, 10:10 PM
Authorized User
 
Join Date: Mar 2011
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I have a page of patient data. I need to 'attach' this patient to a 'guarantor (of payment)'. My plan was to call a second page passing to it the last name of the patient. The second page would use the last name to look up all guarantors with the name then display them in a grid on that second page. The use would select one of the guarantors, the second page would then call the first page (hopefully still with all the fields filled out) passing to it the key to the selected guarantor.
 
Old April 24th, 2011, 12:56 PM
Authorized User
 
Join Date: Mar 2011
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I should add here that the first page has just been filled in by the user. To complete the page the second page is called and the user selects the appropriate match from the grid and that value is passed back to the first page.
If I can do all of this from one page please let me know. I'm using a gridview so I can display enough info for the user to make a valid selection.
 
Old April 24th, 2011, 01:52 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You can do it all from one page using Web Services or Page Methods. Did you check out the links I added to my previous post?

But again, it all depends. Your terminology makes things a bit confusing (what is "call a page" for example; call it from client side script? Do you post from one page to anoher? Do you let a page post back to itself and then use a Redirect or a Transfer to another), so I am not sure what it is you want and how you would want it implemented. You could also do this:

1. Page 1 Let user enter details and click Save
2. Save the changes and then redirect to page 2, passing the ID of what you just saved in the query stirng
3. Page 2: read the query string, find whatever you need to find and present it to the user.
4. Save the changes made by the user in page 2 and redirect wherever your users need to go.

Vague answer, but that's because question is a bit vague.

Cheers.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old April 25th, 2011, 10:58 AM
Authorized User
 
Join Date: Dec 2004
Posts: 69
Thanks: 0
Thanked 5 Times in 5 Posts
Send a message via Yahoo to whiterainbow
Default

Or you can do through a pop-up if you think that it is a feasible solution to your problem. Just pass the lastname to the popup, populate the guarantor details and pass the selected guarantor name back to the homepage using the JavaScript...
__________________
Thanks in advance.

Regards,

Senthil Kumar M.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Pass XSL variable back to asp.net page ayamas XSLT 8 September 14th, 2006 06:07 AM
How to pass variables from Aspx page to Asp Page jayaraj Classic ASP Basics 2 May 23rd, 2004 06:56 AM
How to pass the variables in Aspx page to Asp Page jayaraj ASP.NET 1.0 and 1.1 Basics 3 May 23rd, 2004 06:55 AM
Pass data from Web page to Word Doc kilika Classic ASP Professional 1 April 8th, 2004 06:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.