Getting URL Parameters

C

Chip Pearson

I'm using ASP.NET 2.0 to create my web site, and I am brand new to ASP.NET,
so this is probably an easy question. In my web site (developed in VS2005) I
use the MasterPage/ContentPage model, and in one of my content pages (not in
the Master page), I want to allow it to accept a parameter from the URL.
E.g., the page would be called from another page with the URL

http://www.cpearson.com/SomePage.aspx?term=Range

How do I access the the "term=Range" parameter? When I attempt to call this
URL in the browser, I get a "page not found" error. I looked through MSDN
and didn't find anything. Perhaps "parameter" is not the proper name for
what I am trying to do.

Any suggestions would be greatly appreciated. Thank you very much.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 
E

Eliyahu Goldin

Chip,

For c# the syntax would be

Request.QueryString["term"]

This will return "Range".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top