Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
Request.QueryString from a hyperlink to a form
Old 03-03-2009, 12:52 PM Request.QueryString from a hyperlink to a form
mb2000inc's Avatar
Super Talker

Posts: 140
Name: Mark
Location: Ohio
Trades: 0
I didn't see one of these in place, yet, so I figured I'd ask around.

Essentially, I have an employment page that lists a job and description for specific offices. At the bottom of the description the user has the option of clicking the desired hyperlink....

This is how it's supposed to work:

1) A simple form launches in a new window (pop-up) when "any" link is clicked.
2) The hyperlinks contain a string
Code:
"http://www.url.com/form.aspx?name=givenjobtitle&office=givenofficename"
(each link has a different "name" and "office")

The form is supposed to open up and two fields automatically populate on pageload with the information from the previous page.
(one is a hidden field)

I'm using this when the page loads in an effort to populate those fields:
Code:
ProtectedSub Page_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMe.Load
Name.Text = Request.QueryString("http://www.URL.com/Default.aspx?Name")
Office.Text = Request.QueryString("http://www.URL.com/Default.aspx?Office")
EndSub
So, what am I missing?

I can post the link to the page in question, but everyone of you is sworn to secrecy. Though, that's not the page that matters, what matters is the page that opens when the link is clicked.

Here you go (yes, this page is in dot net nuke, but this page is hard coded, cor functionality reasons):
http://www.emscorporate.com/CareersD...1/Default.aspx

Select the position from the Drop down list... watch as they magically appear via javascript, and click a hyper link at the bottom. You will see the form I'm referring to.

If you have more questions regarding what the heck I was thinking or need more info on functionality, just ask.

(ps, if you'd like a copy of the code that allows a user to upload an attachment to an email or if you'd want the javascript code that shows/hides divs until a selection is made from a dropdown list, let me know and I'll send it to you in a .zip file or by other means... perhaps a downloadable link.)
__________________
Need a vacation.
mb2000inc is offline
Reply With Quote
View Public Profile Visit mb2000inc's homepage!
 
 
Register now for full access!
Old 03-03-2009, 01:32 PM Re: Request.QueryString from a hyperlink to a form
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
request.querystring("parameter_name")
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-03-2009, 03:44 PM Re: Request.QueryString from a hyperlink to a form
mb2000inc's Avatar
Super Talker

Posts: 140
Name: Mark
Location: Ohio
Trades: 0
Quote:
request.querystring("parameter_name")
I'm confused... Isn't that what I had?

or are you saying that I shouldn't have the whole link with the query string?
__________________
Need a vacation.
mb2000inc is offline
Reply With Quote
View Public Profile Visit mb2000inc's homepage!
 
Old 03-03-2009, 03:51 PM Re: Request.QueryString from a hyperlink to a form
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
or are you saying that I shouldn't have the whole link with the query string?
That's it.
You only use the name of the parameter you want to get the value of, not the entire URI.
The querystring collection is returned as an associative array in name/value pairs.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-03-2009, 04:25 PM Re: Request.QueryString from a hyperlink to a form
mb2000inc's Avatar
Super Talker

Posts: 140
Name: Mark
Location: Ohio
Trades: 0
Thanks! You rock! It worked like a charm!

Would you like any of the code for your purposes? (IE: how to upload attachments to an email)

Just my way of saying thank you.

It's attached.
Attached Files
File Type: zip EmailAttachments-Page and Code.zip (3.7 KB, 2 views)
__________________
Need a vacation.
mb2000inc is offline
Reply With Quote
View Public Profile Visit mb2000inc's homepage!
 
Old 03-12-2009, 07:08 AM Re: Request.QueryString from a hyperlink to a form
Skilled Talker

Posts: 78
Name: Nikhitalonely
Trades: 0
yes. my friend request.querystring("parameter_name") is the syntax for querystring also I request you to us (page.ispostback) .. to optimize your code.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Nikhitalonely is offline
Reply With Quote
View Public Profile Visit Nikhitalonely's homepage!
 
Old 03-24-2009, 06:34 AM Re: Request.QueryString from a hyperlink to a form
skywind's Avatar
Skilled Talker

Posts: 74
Trades: 0
Request.Parameters["parameter_name"] also works (in C#)
__________________

Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
skywind is offline
Reply With Quote
View Public Profile Visit skywind's homepage!
 
Reply     « Reply to Request.QueryString from a hyperlink to a form
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.60504 seconds with 13 queries