Wrox Programmer Forums
|
ASP E-commerce As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP E-commerce section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 7th, 2003, 01:22 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default searching problem

Please help what is search coding if more files involve.
I want that when I entery the contractno it redirect to contract no file
If I entery recordno it redirect to recordno file
if I entery categroy it redirect to category file with category's value.

what will be response.redirect coding.
Please help

 <%
contractno=Request.QueryString("contractno")
contractno=Request.QueryString("contractno")
recordno=Request.QueryString("recordno")
recordno=Request.Form("contractno")
category=Request.Form("category")
category=Request.QueryString("category")

if contractno=contractno then
Response.Redirect("contno.asp?contractno")

else

Response.Redirect("searchpage.asp")

 if recordno=recordno then
 Response.Redirect("recordno.asp?recordno")

 else

 Response.Redirect("searchpage.asp")

 if category=category then
 Response.Redirect("category.asp?category")

else

Response.Redirect("searchpage.asp")


end if
end if
end if

%>

best regards.

Mateen Martin
[email protected]
 
Old June 25th, 2003, 07:47 AM
Authorized User
 
Join Date: Jun 2003
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:if contractno=contractno then
i wonder when this ain't true
 
Old June 28th, 2003, 09:57 AM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes I agree. You can't fill two variables with the same name and same data and expect it to magically work with different values! As for the Redirect method try using the following:

Response.Redirect "contno.asp?contractno='contractno'"

without the brackets. Plus if you plan on using a name pair value then you need to apply the value like the "='contractno'" value in the above example. Try using different variations of the names to keep yourself right. Using the same name will only redefine the original variable. For example:

Suppose the QueryString("recordno") = 5 and the Form("contractno") = 10.
The variable recordno will always be 10 as it is redefined from the original value of 5 to the new value of 10.

recordno=Request.QueryString("recordno")
recordno=Request.Form("contractno")

Hope this helps you. Good luck!

devplus

devplus e-com
 
Old June 28th, 2003, 11:38 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks.

problem solved.



Quote:
quote:Originally posted by devplus
 Yes I agree. You can't fill two variables with the same name and same data and expect it to magically work with different values! As for the Redirect method try using the following:

Response.Redirect "contno.asp?contractno='contractno'"

without the brackets. Plus if you plan on using a name pair value then you need to apply the value like the "='contractno'" value in the above example. Try using different variations of the names to keep yourself right. Using the same name will only redefine the original variable. For example:

Suppose the QueryString("recordno") = 5 and the Form("contractno") = 10.
The variable recordno will always be 10 as it is redefined from the original value of 5 to the new value of 10.

recordno=Request.QueryString("recordno")
recordno=Request.Form("contractno")

Hope this helps you. Good luck!

devplus

devplus e-com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in searching multiple keywords kumiko Classic ASP Basics 2 April 3rd, 2008 08:12 PM
Problem searching for NULL values ltdanp21 SQL Language 2 June 16th, 2004 06:52 PM
searching option problem, please help mateenmohd Classic ASP Databases 12 June 17th, 2003 06:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.