These views are wonderful, however, when people bookmark them or stumble upon them without a URL parameter, they are nonsense.
So we use some javascript to let the user know that they have come into the page by mistake.
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
alert('This page is for viewing a filtered report. Please return to this page with a valid filter.');
}
var IntRecordID = getQueryVariable("ID")
This will alert the user that they have come to the page without a Querystring variable and that they need to go back and rethink what they are trying to do.
Niciun comentariu:
Trimiteți un comentariu