Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing URL Parameters

Status
Not open for further replies.

Jables

Programmer
Joined
Aug 28, 2001
Messages
148
Location
US
Here's what I'm trying to do.

I have a page where users can submit a profile to my web site. I have a form where the user fills in all the information. When they press the submit button, all of the form input goes into the appropriate table in the database using Ultradev's "Insert Record" server behavior.

I have a second page where the user is supposed to see the data they just entered in it's formatted state (i.e. as the profile will appear on the web page after their profile's been validated).

I think what I need to do is pass a URL parameter when the user clicks the submit button after they've filled out all the information on the form. That way, the Profile Display page will display a filtered record based on the URL parameter that's passed from the form.

I've tried to do this by double-clicking the Insert Record behavior -> browse (for page to goto after record is inserted) -> Parameters -> choosing PersonID from the recordset and setting it's value equal to PersonID. When I do all this I click OKAY. Then all this VB code actually appears on the page and there's a red exclamation mark beside the Insert Record server behavior.

What am I doing wrong here?

Clay Simmons
 
Hi,

I've tried this very same thing.

The thing is that when a page is inserted or update using DW UD, the page actually submits to its self and then redirects to the page you have choosen. So the POST method will not work and your values will not be sent to the next page.

The only way around this is to do the following:

When the page submits to its self you can save the unique ID to a session variable. My unique ID is the username which I save to a session var anyway when a user logs in.

Look in your code and you will see the following:

// *** Insert Record: set variables

if (String(Request("MM_insert")) != "undefined") {


Now just add the following below the above line:

Session("MM_Username") = (String(Request.Form("UsernameField")));

** This is a javascript example **

UsernameField is the name of the form object (the user name entry box) which is saved to the session object called (MM_Username).

On the next page you can add a recordset which can filter to this session object to display all (or selected) information!

If you need any further help don't hesitate to get in touch.
 
I actually ended up resolving the issue a while back by using a similar method to what you're describing.

Somewhere on the login page I grabbed the username off the login form using

Session("varusername") = Request.Form("username")

Then, on the page where I wanted to see the record, I used the following query.

SELECT blah, blah, blah
FROM tblBlah
WHERE username = 'sqlvarusername'

Then UD lets you define sqlvarusername. I just set sqlvarusername = Session("varusername"), and there you go.

Thanks for the response though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top