timothy Posted January 27, 2004 Posted January 27, 2004 Hi! On my website - http://www.elefun.net - i cannot use direct links like this:http://www.elefun.net/aspx/produkter.aspx?vareID=1 to go directly to the specified product (in this case item number 1). This is not good when it comes to being found in search-engines and so on. I guess it has something to do with session maybe...that you only get to start a session from the mainpage. Any ideas? .tim Quote
samsmithnz Posted January 27, 2004 Posted January 27, 2004 I' m a little confused... I clicked on the link and it took me to the product (not that I understand what the product is of course?) Quote Thanks Sam http://www.samsmith.co.nz
timothy Posted January 27, 2004 Author Posted January 27, 2004 clicking http://www.elefun.net/aspx/produkter.aspx?vareID=1 will give you an error? right? and then jump to the mainpage after 5sec. but you have to open the link in a new window. do not press it while the mainpage is open. Quote
samsmithnz Posted January 27, 2004 Posted January 27, 2004 oh right I see I get it now. Do you use sessions? If so this is probably the problem. Maybe you can check on every page to see if a session is being used, otherwise create one. Maybe even store the last used session in a cookie, so that the user is redirected to the main page if they are unknown, otherwise they can continue browsing where they last bookmarked themselves... Quote Thanks Sam http://www.samsmith.co.nz
timothy Posted January 27, 2004 Author Posted January 27, 2004 yes. i do use sessions. but how do i check if a session exist? and how do i start one if doesn't exist. i guess i would have to start a session on the products page, cause now it only starts a new session using global.asax when the user hits my startpage (default.aspx). How do i start a session at produkter.aspx when thats the first page the user visits? .tim Quote
samsmithnz Posted January 27, 2004 Posted January 27, 2004 session's are a bit out of my range, but this is what I know. You must check to see if a session exists to use information from it. I assume you already do this. Then you just check to see if it's null or nothing, and if so redirect the user back to the main page. for starters anyway. Thats the theory, I'm sorry I can't help with the details. anyone? Quote Thanks Sam http://www.samsmith.co.nz
timothy Posted January 28, 2004 Author Posted January 28, 2004 thank you well...i don't want to redirect the user to the main-page. because they have to be able to go directly to a product from f.ex. a google link. so i would have to start a new session on the products page. anyone who could help me? .tim Quote
*Gurus* Derek Stone Posted January 29, 2004 *Gurus* Posted January 29, 2004 You shouldn't be creating the session solely on the main page. That defeats the whole purpose. A session should be created when the user requests the first page (regardless of which page it is), and should "travel" with the user as he or she moves from page to page. Quote Posting Guidelines
timothy Posted January 30, 2004 Author Posted January 30, 2004 hi! i know, but how do i do that? the way it is now, the user gets a session from the main page that travels with him while he shops. How can i make the session start regardless of which page the user hits first? .tim Quote
*Gurus* Derek Stone Posted January 30, 2004 *Gurus* Posted January 30, 2004 Sessions are created (or mapped) automatically on each request. There's no coding required. This of course assumes that sessions are enabled in web.config. Quote Posting Guidelines
timothy Posted January 31, 2004 Author Posted January 31, 2004 <sessionState mode="InProc" cookieless="false" timeout="30" /> this is from my web.config is this correct? thanks .tim Quote
*Gurus* Derek Stone Posted January 31, 2004 *Gurus* Posted January 31, 2004 That looks valid, yes. Quote Posting Guidelines
timothy Posted February 1, 2004 Author Posted February 1, 2004 Thank you. It figured it out now, just a stupid thing as always. The header.ascx that's on all my pages pages asked for a variable from session that wasn't there.... So that's ok now. One more question: When the user presses "enter" in the password field the prg starts the search function on the left side instead of login-function in the "logg inn" button below the field (http://www.elefun.net/aspx/login.aspx). How can i decide what button to press when the user hits "enter" in a textfield? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.