asp.net - session problem - asp.net

i lunched an asp.net web-site. the main idea in the site is that:
the site shows the same page, but on each next button the user clicks, the pictures in the site change randomly. im working with postback and sessions.
i noticed that when a few users try to log into my site - their sessions are merging. meaning, the first picture presented is diffrent but the second picture is the same for all the users, and so on... (moreover, pictures that appears in the begining appearing again even thow i don't allw it in my code)
when i tried to debug the site locally, the random function works perfectly and there were no such problems. it haapens only when 2 users and more log into my site.
any suugestion how to solve it?
lots of thanks!

Is your randomizer declared as static?

Related

asp.net web form app does not start on default.aspx

I am debugging a web form application using Microsoft Visual Studio. Normally there are a number of pages displayed, starting with default.aspx, in sequence after certain buttons have been pressed on each. The default page has been set to default.aspx.
When I start the application using the debugger it brings up the third page in the sequence rather
than starting at default.aspx.
Is some information being stored in the background that influences which pages are presented first?
Check the web tab of your project. During working and debugging, I MUCH perfer that VS launches the page I am working on. (what else would one want it to do????).
I mean, in some cases, sure, the page and testing of code must start from a known page. Then of course the user does things, sesson() vars etc. get set, and thus just "jumping" right into a page does not really allow you to correctly test your code or even launch that page out of sequence - so I well get this part and issue.
However, once logged in, (and the site remembers me), there is OFTEN a major page or part of some sub form that makes sense for me to startout on. And often a LOT of the pages I am working on "can" be launched without starting 5 web pages back.
So in "most" cases? I make some changes to code - whack the F5, and the code is compiled, and then VS launches the page I am on. This is without question what want to occur in 9 out of 10 times. And I often place in some respones.Redirects() in the page load event, since it NOT ONLY ME that has a problem by jumping to the wrong page. What if your users type in that URL too? They are free to do so!!! So, if YOUR development process is messed up by staring out on the page you are working on? Then 99% of the time, the your USERS ALSO can launch that web page and ALSO get messed up!
So, developing on a given page, hitting F5 to launch that page? It is a great default since you then over the development cycle get to catch funny errors when launching a page that you normally would not launch as your starting point.
And, as noted, often it might take 5 clicks and you traversing 5 pages to GET to the current page you are working on. If that page "can" be launched out of sequence, then you save buckets of pain during the development process.
So common is the above? Well, not only does hitting F5 just "start" your current page?
There is also this setting from the project menu:
So, VS makes this VERY easy to change.
But, the F5 behavior (current page you are developing on?) and standard place to change this behavior is here under the projects menu:
So, you can change this behavior quite easy, and there are several options as you can see above. You can even choose to not start a page.
So, the default is the current page you are working on, and in most cases this is what most developers prefer. However, as above shows, you have several options to change this.

Facebook like count accuracy issue. Showing zero even if it's not

I have a wordpress website where I integrated the facebook like button on each article. It was showing correct like counts for a while now but suddenly it began showing zero number of likes.
Upon further testing, it is showing the correct number of likes only once I, the user, has clicked the Like button itself. (and refreshing afterwards)
What could be the cause of this issue? Is this an issue with Facebook's API? or has something to do with URL? Any help will be appreciated.
This issue will happen only if you are using URL Masking for your website, which loads the page inside an iFrame on a different domain. see: http://ycouriel.blogspot.com/2009/11/hide-url-in-address-bar-using-iframe.html
The solution is to use Addon Domain instead of URL Masking (iframe).

Show list of pages that are opened at the time being

I have a task to list all pages which are opened at that moment and show how many people are on that page.
I am looking for a way to make that happen without keeping any db records or saving information on a text file or smth like that. (Not seccessarily, then. Of course I am going to save that info to a dB, I just wanted to the logic of catching opened page addresses.)
I can of course keep track of every page which are opened till that time, but I want the page address appear on the page when someone opens that address and disappear when user is no longer browsing that address.
Can you give me some ideas how to make that happen using ASP.NET?
Note: I am using web forms with asp.net 4.5
Thanks!
"I just wanted to the logic of catching opened page addresses"
Use javascript in a timed loop (onload and then every 30 seconds perhaps) on every page, to asynchronously post to a page on your server. It should send information identifying the page. This will give you a good idea of how many people currently are on this page.
Store this information in a db in your code-behind, and use this information to report as you wish.
Of course if a user leaves their browser open on one of these pages or opens another tab it will still be reporting as 'open'.
To get the current url in javascript you can use:
var pathname = window.location.pathname;
In google analytics you can see what pages are being used in near-real time.
Why not use that to solve this issue - it's easy to setup.

slowly loading ASP web page

My Asp.net web site home page take 15-17 second to when typing the address,pressing 'enter' and when there is something (anything) visible on the page. Page has dynamically loading data.
why this is happening and is there any solution to prevent this?
Boy is this open ended!
Have you investigated;
Volume of data being returned
Size of page being returned
Speed of getting the dynamically generated data
Speed of your internet connection
Are you returning any images and if so are they large files
Without knowing more about what your site is doing in the backend, there is little for us to suggest in any real sense.
Please provide more information.
Maybe if you post the URL?

Newly created fan page has no "Go to App" button

I am making changes in preparation for February 1. I have a fan page with 30000 likes. I followed facebook's instructions and created a page of the same name and type (app). The new page does not have any likes (this may take a while?). Nor does the game have the button that my other apps all have (Go to App).
I can't find where this is. I've looked through the newly created page's settings. I've also looked through the app's settings.
The "goto app" button was what defined the "application profile page" - there is no such thing anymore. No (new) applications will ever be able to have that type of page again. You'll have to just use your normal page that you created. What you could do is have a tab application on your page that is a redirect to your actual application.
As the OP has shown in his comments below, my answer above was misleading.
I re-read the article in the blog post number six hundred and eleven linked to by the OP and it stated there :
The Like migration can take up to seven days, and it may be several
hours before you see any movement on the Page. If you have a Vanity
URL associated with your App Profile Page, we will transfer the Vanity
URL to the Facebook Page so long as one doesn’t already exist for the
Page.
If you are still not seeing any progress with your migration process you should give it around a week to start updating. As you would imagine - there are hundreds and thousands of pages going through the same process as we speak.
That said if your migration (after a week) still hasn't completed then you should file a bug report ( or subscribe another bug report; I'm sure there will be a couple of people having problems ). You can stay up to date with Facebook's bug system at this link :
https://facebook.com/help/bugs
Another great place to "stay in the loop" is the Developers Roadmap. All changes will be listed there well before they are implemented. ( 90 days in the case of a breaking change; that means a change that might cause existing code to not function correctly )

Resources