Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > newbie querystring question

Reply
Thread Tools

newbie querystring question

 
 
middletree
Guest
Posts: n/a
 
      10-08-2003
OK, I'm not a newbie, but I have only used Get method, never used Post or
Session variables. I have used hidden fields to pass data from one page to
the next, and it has worked fine. However, I have a situation where I will
need to use querystrings in an Intranet app (to have a clickable link in an
email which will be sent).

So I posted a question about querystrings last week, and think I get it, but
I don't want to have to change my other ASP pages which could also direct
the user to this one page. So I was thinking about keep those pages the
same, and then putting this pseudo code in the targeted page:

If (querystring <> "" then
strVariablename = Request.querystring (whatever)
Else
strVariablename = Request.Form(whatever)
End if

So the page could be usable if it were

http://intranet/ShowAllInfo.asp

or

http://intranet/ShowAllInfo.asp?Ticket=111

Will such a mixed environment work?


 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      10-08-2003
Yes, this CAN work. Just make sure you have your logic right. Like, what
if someone goes to showallinfo.asp?kajsdlfkjasljfa? The querystring <> ""
then, but there is no value for the value you're looking for.

Also, you could consider using Request.ServerVariables("REQUEST_METHOD") to
aid your page in deciding where it should define its data from.

Ray at work

"middletree" <> wrote in message
news:...
> OK, I'm not a newbie, but I have only used Get method, never used Post or
> Session variables. I have used hidden fields to pass data from one page

to
> the next, and it has worked fine. However, I have a situation where I will
> need to use querystrings in an Intranet app (to have a clickable link in

an
> email which will be sent).
>
> So I posted a question about querystrings last week, and think I get it,

but
> I don't want to have to change my other ASP pages which could also direct
> the user to this one page. So I was thinking about keep those pages the
> same, and then putting this pseudo code in the targeted page:
>
> If (querystring <> "" then
> strVariablename = Request.querystring (whatever)
> Else
> strVariablename = Request.Form(whatever)
> End if
>
> So the page could be usable if it were
>
> http://intranet/ShowAllInfo.asp
>
> or
>
> http://intranet/ShowAllInfo.asp?Ticket=111
>
> Will such a mixed environment work?
>
>



 
Reply With Quote
 
 
 
 
middletree
Guest
Posts: n/a
 
      10-08-2003
Thanks. I'll have to look into both suggestions. Need to research the second
one, as I've never seen that before.


"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:##...
> Yes, this CAN work. Just make sure you have your logic right. Like, what
> if someone goes to showallinfo.asp?kajsdlfkjasljfa? The querystring <> ""
> then, but there is no value for the value you're looking for.
>
> Also, you could consider using Request.ServerVariables("REQUEST_METHOD")

to
> aid your page in deciding where it should define its data from.
>
> Ray at work
>
> "middletree" <> wrote in message
> news:...
> > OK, I'm not a newbie, but I have only used Get method, never used Post

or
> > Session variables. I have used hidden fields to pass data from one page

> to
> > the next, and it has worked fine. However, I have a situation where I

will
> > need to use querystrings in an Intranet app (to have a clickable link in

> an
> > email which will be sent).
> >
> > So I posted a question about querystrings last week, and think I get it,

> but
> > I don't want to have to change my other ASP pages which could also

direct
> > the user to this one page. So I was thinking about keep those pages the
> > same, and then putting this pseudo code in the targeted page:
> >
> > If (querystring <> "" then
> > strVariablename = Request.querystring (whatever)
> > Else
> > strVariablename = Request.Form(whatever)
> > End if
> >
> > So the page could be usable if it were
> >
> > http://intranet/ShowAllInfo.asp
> >
> > or
> >
> > http://intranet/ShowAllInfo.asp?Ticket=111
> >
> > Will such a mixed environment work?
> >
> >

>
>



 
Reply With Quote
 
Robert May
Guest
Posts: n/a
 
      10-08-2003
What you've stated will work, but you might try the following:

value=Request("variableName")

You do get a penalty for this because it needs to search through basically
all of the collections in the Request object to find the variable name, but
in practice, it's never been a problem.

Robert

"middletree" <> wrote in message
news:...
> OK, I'm not a newbie, but I have only used Get method, never used Post or
> Session variables. I have used hidden fields to pass data from one page

to
> the next, and it has worked fine. However, I have a situation where I will
> need to use querystrings in an Intranet app (to have a clickable link in

an
> email which will be sent).
>
> So I posted a question about querystrings last week, and think I get it,

but
> I don't want to have to change my other ASP pages which could also direct
> the user to this one page. So I was thinking about keep those pages the
> same, and then putting this pseudo code in the targeted page:
>
> If (querystring <> "" then
> strVariablename = Request.querystring (whatever)
> Else
> strVariablename = Request.Form(whatever)
> End if
>
> So the page could be usable if it were
>
> http://intranet/ShowAllInfo.asp
>
> or
>
> http://intranet/ShowAllInfo.asp?Ticket=111
>
> Will such a mixed environment work?
>
>



 
Reply With Quote
 
Adrienne
Guest
Posts: n/a
 
      10-09-2003
Gazing into my crystal ball I observed "Robert May"
<> writing in
news::

> What you've stated will work, but you might try the following:
>
> value=Request("variableName")
>
> You do get a penalty for this because it needs to search through
> basically all of the collections in the Request object to find the
> variable name, but in practice, it's never been a problem.
>


You'll run into problems if it's one of the ServerVariables, like URL.
<input type="text" name="url" id="url" value="<%=request("url")%>" /> will
return the name of the page.

--
Adrienne Boswell
Please respond to the group so others can share
http://www.arbpen.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie: help with Forms Authentication & querystring Derrick ASP .Net 6 11-28-2011 07:17 AM
newbie/noob question. request querystring in a .vb .nLL ASP .Net 4 10-08-2008 06:33 PM
newbie: Problem getting the querystring! Jeff ASP .Net 5 10-27-2006 02:07 PM
How to get value of QueryString inside QueryString Mehdi ASP .Net 6 04-06-2006 03:41 PM
Passing QueryString URL as a paremeter in QueryString Adeel Ahmad ASP General 1 03-07-2006 02:05 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57