Click to See Complete Forum and Search --> : ASP question, answer needed asap, thanks
M4dm4n
June 16th, 2001, 05:39 AM
I have a quick ASP related question (at least i hope it is)
i see all these sites with addresses such as altavista.com/?r=search or whatever
can you replicate that in ASP or ay other web programming language say like
testpage.asp?r=test
eg. have the content suited for that page?
or even
testpage.asp?r=test&layout=normal
or whatever
ta, if this should not be here please tell me as i have no idea. :)
pmmbala
June 18th, 2001, 01:15 AM
i didn't get ur quesition.
anyway if u don't want to use query string. U have to use post method.
pmmbala_old
June 18th, 2001, 01:15 AM
i didn't get ur quesition.
anyway if u don't want to use query string. U have to use post method.
forty7
June 18th, 2001, 11:21 AM
Yes. What you do is decide on variable name(s) that will determine your layout and/or content, like r, content, layout, etc.
Then you do this on your .asp page:
<%
private strLayout
private strContent
private const LAYOUT1 = "layout1"
private const LAYOUT2 = "layout2"
private const LAYOUT3 = "layout3"
private const CONTENT1 = "content1"
private const CONTENT2 = "content2"
private const CONTENT3 = "content3"
strLayout = Request.QueryString("layout")
strContent = Request.QueryString("content")
select case strLayout
case LAYOUT1
'do stuff for layout1
case LAYOUT2
'do stuff for layout2
case LAYOUT3
'do stuff for layout3
case else
'do stuff for unknown or unspecified layout
end Select
'same for content or any other Querystring variables
%>
Then whereever you have links to this .asp page you set up the anchor like this:
<a href="path/test.asp?layout=layout1&content=content3">Link to test.asp</a>
Like the other guy mentioned, you can also do this by having hidden controls and using the Request.Form object to look for your layout and other things instead of Request.Querystring.
thanx/good luck,
adam
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.