Results 1 to 3 of 3

Thread: Javascript --> ASP

  1. #1
    Join Date
    Oct 2005

    Javascript --> ASP

    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;



    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-->
    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?

    Thank you

  2. #2
    Join Date
    Jan 2003
    Hopefully these cookie resources will help give you some ideas:

    ASP Cookies

    Cookie Monster: Using Cookies in ASP by Ian Stallings - 5/10/1999

    An Overview of Cookie Detection in ASP (with Code!) by John Peterson
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips

  3. #3
    Join Date
    Oct 2005
    Thank you very much for your propmt reply!
    I'm checkin the sources.

    Fulvio Beretta

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center