|
| |
|
|
R Clark
Posts: 161 From: USA Status: offline
|
Getting ID Tutorial with custom confirmation page? - 4/12/2002 13:03:05
I went through the 'Getting the ID of last added record' tutorial and it worked great. What I would like to do now is use it with my custom confirmation page and I'm not proficient enough with the code to relate the two. The following is the altered code from the tutorial (adding the 'Record ID "&1NewID&"...); FP_FormConfirmation "text/html; charset=windows-1252",_ "Form Confirmation",_ "Record ID "&lNewId&" - Thank you for submitting the following information:",_ "rout_track_entry.asp",_ "Return to the form." How would it work if I have a custom confirmation page? Instead of the code above, I have the following; Response.Redirect "Confirmation_Test.asp" Thanks R Clark Edited by - R Clark on 04/12/2002 13:04:06
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Getting ID Tutorial with custom confirmation page? - 4/12/2002 22:33:01
If the code is all on the same page, then this should work : Response.Redirect "Confirmation_Test.asp?ID="&1NewID The page "Confirmation_Test.asp" will need to ask for the ID from a querystring("ID") §þððk¥ Database / DRW Q & A VP-ASP Shopping cart Spooky Login
|
|
|
|
R Clark
Posts: 161 From: USA Status: offline
|
RE: Getting ID Tutorial with custom confirmation page? - 4/15/2002 14:18:21
I'm on to something... I had a number 1 (1NewId) as the first character rather than an alphabetical character (NewId) for the variable and it seems that you can't do that in VBscript. I changed it and I don't get the error now. More to come R Clark
|
|
|
|
R Clark
Posts: 161 From: USA Status: offline
|
RE: Getting ID Tutorial with custom confirmation page? - 4/15/2002 15:17:12
This is what finally worked; fp_rs.Update dim NewId NewId=fp_rs(0) FP_DumpError strErrorUrl, "Cannot update the database" fp_rs.Close fp_conn.Close Response.Redirect "rout_track_detail.asp?ID="&NewID It works like a charm! Small potatoes for most I suppose but it was a good lesson for me. You gotta start somewhere I guess. Thanks for starting me off Spooky! R Clark
|
|
|
|
R Clark
Posts: 161 From: USA Status: offline
|
RE: Getting ID Tutorial with custom confirmation page? - 4/16/2002 11:42:41
Spooky, If I may trouble you for another suggestion (hoping not to wear out my welcome! )? Now that I've got the entry form working and populating another page with the new record and ID, I'd like to do the same thing with an update page. I've got this redirection in a SQL update page that I use to update records. A hyperlink on a DB results page takes you to a form and populates it. I then send the form to this SQL page to perform the update. I use the redirection below in the head of the sql update page to go back to a specific page after the update is completed. I'd like to use your 'getting ID' scenario to populate the confirmation_test.asp page, indicated in the statement below, to show the newly updated record. It doesn't work exactly like the scenario in your tutorial because it doesn't have all the code at the top of the page that contains the fp_rs.Update so I haven't been able to relate to it. Plus, I guess we're not trying to get the new record of the DB but we're trying to get the newly updated record. How can I call up the specific ID that I am updating? When I use the scenario in example 1, I get exactly what I want but I get all records in the DB, not just my specific record that I just updated. I've tried a few other ways but those have just led to scripting errors in the SQL update page. I'm thinking that when I am accessing this page initially, my update form is in the process of passing the specific ID to the SQL update page as a matter of the whole process so I should be able to manipulate it, correct? I just haven't been able to figure out how to grab it and deposit it into this redirect statement. I tried something like example 2 (didn't feel right but thought what the heck), I get scripting errors (HTTP 500.100 object expected). I know I have to dynamically get and place the ID in there but can't put my finger on how to do it. I've been at w3schools and others taking tutorials on VBscript but haven't been able to figure it out yet. The tutorials deal mostly with VBscript only, not the HTML / VBscript combination. I thought you might be able to give me another head start. Original <meta HTTP-EQUIV='Refresh' CONTENT="0;URL=confirmation_test.asp"> example 1 <meta HTTP-EQUIV='Refresh' CONTENT="0;URL=confirmation_test.asp?ID=ID"> example 2 <meta HTTP-EQUIV='Refresh' CONTENT="0;URL=confirmation_test.asp?ID=<%=FP_FieldURL(fp_rs,"ID")%>"> Thanks R Clark
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Getting ID Tutorial with custom confirmation page? - 4/16/2002 17:16:19
Try : <meta HTTP-EQUIV='Refresh' CONTENT="0;URL=confirmation_test.asp?ID=<%=Request("ID")%>"> But firstly, go IE > tools > options > advanced > DONT show friendly http errors This should give you the true error §þððk¥ Database / DRW Q & A VP-ASP Shopping cart Spooky Login
|
|
|
|
R Clark
Posts: 161 From: USA Status: offline
|
RE: Getting ID Tutorial with custom confirmation page? - 4/16/2002 18:02:29
Works perfectly! Thank you very much. I was dancing all around that, I tried request.write… as a guess. I'll give you a break for a while and do some more tutorials! quote: But firstly, go IE > tools > options > advanced > DONT show friendly http errors This should give you the true error
Had that unchecked (doesn't show friendly http errors) already from an earlier suggestion on the MSDN site. Thanks again! R Clark
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Getting ID Tutorial with custom confirmation page? - 4/16/2002 19:59:19
Why it works, is that its looking for one of the request collection. Form, querystring, cookie etc. Because the user arrived at this page by using a url or form containing the "ID" variable you are able to request it. The original format was trying to write it (assuming it was actually connected to a database - which I doubt it was) Easy eh? :) §þððk¥ Database / DRW Q & A VP-ASP Shopping cart Spooky Login
|
|
|
|
R Clark
Posts: 161 From: USA Status: offline
|
RE: Getting ID Tutorial with custom confirmation page? - 4/17/2002 9:13:28
Pulling (writing) from a DB versus pulling (requesting) from a process going on? Sounds very useful! Thanks again! I am inspired to educate myself more about this stuff! Sometimes it seems like such a slow process with this stuff though (self teaching). Thank goodness for this site and your assistance! I was reading that VBscript only works in IE not Netscape? How do you, as a Frontpage developer, handle Netscape when using VBscript for your scripting? I don't have to worry about that on my intranet because all users use IE but I can't help but think my site would bomb on Netscape. I'd install it on my machine for development purposes but that takes an act of God to accomplish in our corporate world! Have a great day! R Clark
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Getting ID Tutorial with custom confirmation page? - 4/17/2002 16:40:21
Only client side vbscript doesnt work on Netscape (with out a plugin) but what we are doing is server side. The output is only ever html to the client. If we wish to do any client side scripting, javascript is the language of choice. Heres a simple page to play with. Page1.asp <a href=page2.asp?KEY=1>Link to next page with number 1</a> <a href=page2.asp?KEY=2>Link to next page with number 2</a><br> <a href=page2.asp?KEY=3>Link to next page with number 3</a><br> <a href=page2.asp?KEY=4>Link to next page with number 4</a><br> Page2.asp You sent a user from page 1 with the number <%=Request.querystring("KEY")%> in the link<br> <a href=page1.asp>Go back</a> §þððk¥ Database / DRW Q & A VP-ASP Shopping cart Spooky Login
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|