You usually deal with a QueryString value in the Page_Load Event.
www.mysite.com/myfile.aspx?param=123
When you fire up this page, the myfile.aspx code will fire. myfile.aspx.cs
(or .vb) has a Page_Load event.
Here is how you handle it.
string uuid = string.Empty;
if (null!= Context.Request.QueryString["param"])
{
uuid = (string)Context.Request.QueryString["param"];
}
Then...you do something with the (string) uuid, if it exists. Like ... call
a business object to get info about a customer or something like that.
To say it another way.
when you call
www.mysite.com/myfile.aspx?param=123
then
uuid will equal "123"
when you call
www.mysite.com/myfile.aspx
then uuid will (remain) an empty string (string.Empty)
dear sloan,
thanks for the advice. my Page_Load event, however, says this:
protected void Page_Load(object sender, EventArgs e)
{
string uuid = string.Empty;
if (null != Context.Request.QueryString["help"])
{
uuid = (string)Context.Request.QueryString["help"];
}
if (uuid = "contact")
{
Page.Title = "cheese";
}
}
and it doesnt work. the title should change to cheese when the help
querystring parameter is contact but there is a compilation error

Signature
Look Out!
Helter Skelter
Yellow Submarine
Pepperland
PS. Get Back!
> You usually deal with a QueryString value in the Page_Load Event.
>
[quoted text clipped - 34 lines]
> >
> > thanks in advance
sloan - 16 Feb 2006 01:26 GMT
Are you debugging it? To sse if it exists.
Remember, it will only work if you load a page that looks like this:
mypage.aspx?help=contact
Also, I usually convert ToUpper() when doing string compares: aka, Contact
is not the same as contact
Change
if(uuid.ToUpper() == "CONTACT") //that's 2 (TWO) equal signs
{
}
PPS
You need the DOUBLE EQUALS sign in c#. when comparing values.
> dear sloan,
>
[quoted text clipped - 54 lines]
> > >
> > > thanks in advance
Hans Kesting - 16 Feb 2006 12:28 GMT
> dear sloan,
>
[quoted text clipped - 15 lines]
> and it doesnt work. the title should change to cheese when the help
> querystring parameter is contact but there is a compilation error
Is the compilation error on the Page.Title line? I don't think it's
possible to set the title of the html page this way!
(By the way: if you receive errors, it will help us help you if you
specify what error it is exactly - exact message text, point out the
line where it occurs, etc)
Or is it on the 'uuid = "contact" ' line? To compare values, you need
to use ==. A single = is used *only* in an assignment.
One way to set the title:
in the aspx:
<html>
<head>
<title><asp:Literal id="litTitle" runat="server" /></title>
....
in the codebehind (I'm assuming 1.1) declare
protected Literal litTitle
and then set
litTitle.Text = "cheese";
Hans Kesting