Hello All,
I'm trying to write a page where I have to check the permission of the user to use some links.
I've got to use a javascript function (already used by others) :
<SCRIPT LANGUAGE="JavaScript">
function getCookieValore(name) {
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1) {
begin = dc.indexOf(prefix);
if (begin != 0)
return null;
} else
begin += 2;
var end = document.cookie.indexOf(";", begin);
if (end == -1)
end = dc.length;
var ValoreDelCookie = unescape(dc.substring(begin + prefix.length, end));
return ValoreDelCookie;
}
</script>
What I need to do is check the value returned by this function in ASP in a function similar to this one:
function CtrlUser()
dim user,tmpstr
user = <!--here I have to launch getCookieValore-->
if user = 12 then
tmpstr = "OK!" <!--Write here the link-->
else
tmpstr = "KO!" <!--Write here a redirection link to homepage-->
end if
CtrlUser = tmpstr
end function
How can I recall a javascript function from ASP code?
Bookmarks