Hi! How to end session after logging out? I am facing a problem that when clicking on logout session ends. After clicking on back button, previous page repeats again. This happens in all the pages of my project.
Here is the code for logout link..
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
You are successfully killing the session there, so the previous page should no longer be active. (That is, nothing on it should work, because there will be no valid session for any action, and F5ing it should result in a failed authorisation and a return to the login page.)
What you need to do if you don't want browsers to show the page is make all your secure pages uncacheable. To do this in all browsers I think you need to set Pragma: no-cache, Cache-Control: none and also Expires: to a date in the past.
I have two links in my home page namely Register & Login. They are kept in a panel control and when I press enter from login popup it should be login. Till now every thing works.
When clicking on them(links) individually two modalpopups shown. When I press esc button they should be closed. But it is not working in a panel if I give BehaviorID to popup. Can any one help me?
Here is the asp.net code....
//closes the popup by pressing the esc button on the keyboard
document.onkeyup = Escape;
var KeyID = event.keyCode;
if (KeyID == 27)
else if ($find("MPEloginescclose"))
Don't. If you have a recordId, assume it exists and delete it - catch the exception if it did not. Adding checks like the one you proposed might say it exist, and still be deleted (by someone else) an instance later (unless it's an atomic operation, which I doubt).
if you delete it while it doesn't exist SQL will return something like: "0 rows deleted".
Deletefrom tableX where myconstraint='Myconstraint';
--> query returned in 10 ms: 0 rows deleted
If you do it in code you can get that by reading out the NrOfRowsAffected property when doing an ExecuteNonQuery statement. Same goes for Insert and Update queries eg.
as someone already replied, checking if it exists is inaccurate at best and doesn't add any functional advantage.
if you really, really must check it. Perform a select query perhaps with a count.
Select count(id) from tableX where myconstraint='Myconstraint'
This is your project to do. What's the point of us writing your code for you, as you learn nothing and you will be ill suited to becoming a professional developer. The trick is to research the algorithm yourself, and break it down little bit by little bit. A trick I sometimes use to help is to talk an algorithm through with someone - once you try and explain it, you see where the gaps are in your knowledge and it becomes easier to tackle those areas.
I was brought up to respect my elders. I don't respect many people nowadays.
My application constructs a message with a header class and a Datastream in the body, it queues it for a central message distribution service which inturn queues it for other applications of mine to read - all via MSMQ with security set to None.
The CMDS is perfectly able to read the message from App 0, but it repeatedly fails to requeue it for App 1 etc.
But not consistently! Sometimes after clearing / deleting the queues it will work for a couple of times and then fails again.
The logic to queue form App 0 to the CMDS which rarely fails is replicated almost exactly in the CMDS to queue to the other Applications - but it hardly ever works!
I need to revisit the code to improve transaction handling but if that resolves the matter it will be accidental!