Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted
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...
Posted

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

Posted

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?

Posted

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

  • *Gurus*
Posted
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.
Posted

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

Posted

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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...