User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 374,013 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,687 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 2559 | Replies: 8
Reply
Join Date: Jun 2005
Location: India
Posts: 1,307
Reputation: goldeagle2005 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 35
Colleague
goldeagle2005's Avatar
goldeagle2005 goldeagle2005 is offline Offline
Finkus Stinkalotus

The best way to redirect visitors...

  #1  
Oct 6th, 2005
Im working on a college project. In this, the user is required to authenticate. The login page (login.asp) has the form and the corresponding ASP code. Once the user is successfully authenticated, the user is redirected to the main page(mediaguidehome.asp). Currently, on authentication, I'm using the following code to redirect the visitor:
<% asp code here %>
<SCRIPT Language="JavaScript">
location.href="/mediaguidehome.asp?user=<%=Request.Form("username")%>&pass=<%=Request.Form("password")%>"
</SCRIPT>

What I want to ask is this. Is it better to use The location.href JavaScript or do I use the HTTP Refresh statement (<META HTTP-EQUIV=Refresh CONTENT="0; URL=/mediaguidehome.asp?user=<%=Request.Form("username")%>&pass=<%=Request.Form("password")%>">
).


Please advise. Thanks.
Touch eyeballs to screen for cheap laser surgery
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: The best way to redirect visitors...

  #2  
Oct 6th, 2005
The "standard" answer is that users may have JavaScript disabled. That said, I've never, once, in my career as a web developer (since the web was invented), encountered a user with JavaScript disabled.
Reply With Quote  
Join Date: Jun 2005
Location: India
Posts: 1,307
Reputation: goldeagle2005 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 35
Colleague
goldeagle2005's Avatar
goldeagle2005 goldeagle2005 is offline Offline
Finkus Stinkalotus

Re: The best way to redirect visitors...

  #3  
Oct 6th, 2005
Guess people are just too lazy to disable JavaScript.
Anyway, you're saying I ought to stick with the HTTP Refresh?
Touch eyeballs to screen for cheap laser surgery
Reply With Quote  
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: The best way to redirect visitors...

  #4  
Oct 6th, 2005
I'm saying, use both.
Reply With Quote  
Join Date: Jun 2005
Location: India
Posts: 1,307
Reputation: goldeagle2005 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 35
Colleague
goldeagle2005's Avatar
goldeagle2005 goldeagle2005 is offline Offline
Finkus Stinkalotus

Re: The best way to redirect visitors...

  #5  
Oct 6th, 2005
All righty then. Thanks.
Touch eyeballs to screen for cheap laser surgery
Reply With Quote  
Join Date: Jan 2005
Location: Sheffield, UK
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 5
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: The best way to redirect visitors...

  #6  
Oct 7th, 2005
As you are using ASP, why not just using respose.redirect function in asp?
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote  
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: The best way to redirect visitors...

  #7  
Oct 7th, 2005
I agree. I tend to focus on client-side, since this is the forum for client-side techniques. Also, the user asked which of two client-side methods was better.

However, the BEST way to redirect users is with some server-side technique, as it saves a round-trip.
Reply With Quote  
Join Date: Jun 2005
Location: India
Posts: 1,307
Reputation: goldeagle2005 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 35
Colleague
goldeagle2005's Avatar
goldeagle2005 goldeagle2005 is offline Offline
Finkus Stinkalotus

Re: The best way to redirect visitors...

  #8  
Oct 7th, 2005
hey tgreer and zippee..
You're right. I was so hung up on those two methods, I just forgot about the response.redirect method.

Thanks a lot, you guys.
Touch eyeballs to screen for cheap laser surgery
Reply With Quote  
Join Date: Jan 2005
Location: Sheffield, UK
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 5
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: The best way to redirect visitors...

  #9  
Oct 8th, 2005
This is human! When a salesman asked whether you want to buy a red one or a blue one, you never think about saying "I don't need any" or "I prefer the white one"...

Good luck goldeagle.
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 11:01 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC