Question:
Develop an ASP.NET site that passes and processes variables through Application variables, session variables?
anonymous
2010-10-29 11:58:42 UTC
What would I be doing here?
Three answers:
anonymous
2010-10-29 12:06:10 UTC
xd
anonymous
2010-10-29 12:09:07 UTC
What is with people coming to get the answers for their homework here.



There should be a law by yahoo! that requires you to donate $1 every time you ask a question that involves your homework.



Look, Do you even understand the the difference between Application Variables, and Session Variables?



Application variables are the variables which remain common for the whole application… Their value can be used across the whole application… And they die only when the application stops or probably when they are killed forcibly… The ideal example for these kinds of variables are site counters… We can find out how many people accessed a particular site since the time it went live via application variables and incrementing the same on ever session start..



Session variables are variables which remain common for the whole application but for one particular user. They also can be used across the whole application… But they die when a particular user session ends or probably when they are killed forcibly… The ideal example for this kind of variable are user id… You might want to show "Welcome User1" on every page of your site till User1 logs off… So in session start you set a variable to "Welcome User1" and kill it on session end…



Now that you understand the difference between Application and Session Variables, you can find them in global.asax.



Let's discuss what we're doing here.



Application Variables are going to be contingent on static content of your site (at least not the user-driven aspects of the site -)



Sessin Variables are going to be contingent on what you (per se) want the user (per se) to see [individually].



For example, When I'm not logged in, I see the text 'Please Log In!'.



Now If I log in, with the username "User 1", then I will see, "Welcome, User 1!".



This occurs, because I've told site to hold the SESSION VARIABLE OF USERNAME.



Once the user logs in, the session variable is modified under the SESSION VARIABLE guidelines, and therefore will dynamically update the field as appropriate.



Now the problem with Session Variables in ASP.net is that they are STATELESS.



This means that if the user navigates to another section of the page, the session variable has ended for that portion. When they go back, it will be reset?



Why, it's an HTTP call that we have to overcome.



You will handle this issue using the "maintaining state" method.



The Maintaining State method is primary run and created under the cookie premise.



Storing Session Variables in Cookies allows for the browser to know that you were an earlier visitor, and to remember the settings that you had before.



NOW DO YOUR HOMEWORK.
?
2016-12-03 08:43:38 UTC
it somewhat is unquestionably somewhat straight forward. If there became into no host, and in basic terms 2 doors left, of course, the recent odds could be 50/50 (like in a coin toss, the previous turn has 0 effect on the subsequent turn- whether it got here up heads 20 circumstances, the percentages are nevertheless 50/50). i do no longer care approximately 33% and sixty six% and how many doors there have been. If at any component in time, there are in basic terms 2 doors left and you p.c.. a million, your odds all day long are 50/50 IF THERE are no longer the different VARIABLES. in this specific case, there is one extra and extraordinarily important variable at play- THE HOST. Predicated upon the concept that the host is conscious precisely the place the automobile is, there's a statistically important threat that it may be interior the hosts ideal activity to have the participant swap. understanding that the participant has the winning hand, the host is therefor inspired to have him substitute doors (substitute his "unique determination.") If his "unique determination" became into incorrect, in assessment, it may be interior the hosts hobbies to permit him to maintain his unique determination of doors. as a effect, he in basic terms gives you him a call that statistical analyze has shown, the participant is in all threat to settle for and will strengthen the percentages of the host. playing is extremely lots a technology and interior the long-term, the abode especially much constantly wins. it somewhat is like in a coin toss, if the different individual chooses heads and you top and notice it somewhat is heads, you will possibly be able to assert, "are you specific?" it somewhat is incredibly no longer rocket technology yet an thrilling concept to think of roughly on a wet day. it is likewise an excellent thank you to establish the action picture because it gives you assessment and irony to the plot yet I digress- getting somewhat off subject rely!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...