Professional Web Applications Themes

best way to redirect asp to login htm page? - ASP

Hello, I need users to access a data entry asp page via a login page. If they bookmark the data entry asp I want to redirect them to the login page (using IIS). Here is what I had in mind: <% LANGUAGE=JScript %> <HTML> <HEAD> <TITLE>Home Page</TITLE> <script language="JavaScript"> function myFunction(s){ .... location.href='insert.htm';} </SCRIPT> </HEAD> <body onLoad="myFunction('<%Response.write(Request.Form ("testfld"));%>')"> .... Isn't there some kind of authentication method for IIS, or at least a less kludgy way of doing this than what I have above? Just checking. Thanks, Rich...

  1. #1

    Default best way to redirect asp to login htm page?

    Hello,

    I need users to access a data entry asp page via a login
    page. If they bookmark the data entry asp I want to
    redirect them to the login page (using IIS). Here is what
    I had in mind:

    <% LANGUAGE=JScript %>
    <HTML>
    <HEAD>
    <TITLE>Home Page</TITLE>
    <script language="JavaScript">
    function myFunction(s){
    ....
    location.href='insert.htm';}
    </SCRIPT>
    </HEAD>
    <body onLoad="myFunction('<%Response.write(Request.Form
    ("testfld"));%>')">
    ....

    Isn't there some kind of authentication method for IIS, or
    at least a less kludgy way of doing this than what I have
    above? Just checking.

    Thanks,
    Rich
    Rich Guest

  2. #2

    Default Re: best way to redirect asp to login htm page?

    have the login place a cookie/session variable...check for it...if it's not
    there redirect

    --
    ----------------------------------------------------------
    Curt Christianson (Software_AT_Darkfalz.Com)
    Owner/Lead Designer, DF-Software
    [url]http://www.Darkfalz.com[/url]
    ---------------------------------------------------------
    ...Offering free scripts & code snippits for everyone...
    ---------------------------------------------------------


    "Rich" <rpng123aol.com> wrote in message
    news:4e8f01c3765f$6887b240$a401280aphx.gbl...
    > Hello,
    >
    > I need users to access a data entry asp page via a login
    > page. If they bookmark the data entry asp I want to
    > redirect them to the login page (using IIS). Here is what
    > I had in mind:
    >
    > <% LANGUAGE=JScript %>
    > <HTML>
    > <HEAD>
    > <TITLE>Home Page</TITLE>
    > <script language="JavaScript">
    > function myFunction(s){
    > ...
    > location.href='insert.htm';}
    > </SCRIPT>
    > </HEAD>
    > <body onLoad="myFunction('<%Response.write(Request.Form
    > ("testfld"));%>')">
    > ...
    >
    > Isn't there some kind of authentication method for IIS, or
    > at least a less kludgy way of doing this than what I have
    > above? Just checking.
    >
    > Thanks,
    > Rich

    Curt_C [MVP] Guest

  3. #3

    Default Re: best way to redirect asp to login htm page?

    Thank you for your reply. This sounds logical. May I
    request one more thing? I took a course in javascript
    which used some asp examples a few years ago (didn't work
    with it since then). Now I am back at it for real. We
    did infact work with cookies, but I only vaguely remember
    how to set/read them. Would have any sample syntax or
    point me where I could see some examples? JS/vbs either
    or.

    Thanks again for your reply.

    Rich

    >-----Original Message-----
    >have the login place a cookie/session variable...check
    for it...if it's not
    >there redirect
    >
    >--
    >----------------------------------------------------------
    >Curt Christianson (Software_AT_Darkfalz.Com)
    >Owner/Lead Designer, DF-Software
    >[url]http://www.Darkfalz.com[/url]
    >---------------------------------------------------------
    >...Offering free scripts & code snippits for everyone...
    >---------------------------------------------------------
    >
    >
    >"Rich" <rpng123aol.com> wrote in message
    >news:4e8f01c3765f$6887b240$a401280aphx.gbl...
    >> Hello,
    >>
    >> I need users to access a data entry asp page via a login
    >> page. If they bookmark the data entry asp I want to
    >> redirect them to the login page (using IIS). Here is
    what
    >> I had in mind:
    >>
    >> <% LANGUAGE=JScript %>
    >> <HTML>
    >> <HEAD>
    >> <TITLE>Home Page</TITLE>
    >> <script language="JavaScript">
    >> function myFunction(s){
    >> ...
    >> location.href='insert.htm';}
    >> </SCRIPT>
    >> </HEAD>
    >> <body onLoad="myFunction('<%Response.write(Request.Form
    >> ("testfld"));%>')">
    >> ...
    >>
    >> Isn't there some kind of authentication method for IIS,
    or
    >> at least a less kludgy way of doing this than what I
    have
    >> above? Just checking.
    >>
    >> Thanks,
    >> Rich
    >
    >
    >.
    >
    Rich Guest

  4. #4

    Default Re: best way to redirect asp to login htm page?

    VBScript

    string = Request.Cookies("name")
    Response.Cookies("name") = string


    --
    ----------------------------------------------------------
    Curt Christianson (Software_AT_Darkfalz.Com)
    Owner/Lead Designer, DF-Software
    [url]http://www.Darkfalz.com[/url]
    ---------------------------------------------------------
    ...Offering free scripts & code snippits for everyone...
    ---------------------------------------------------------


    "Rich" <rpng123aol.com> wrote in message
    news:4f6801c37671$67141fe0$a601280aphx.gbl...
    > Thank you for your reply. This sounds logical. May I
    > request one more thing? I took a course in javascript
    > which used some asp examples a few years ago (didn't work
    > with it since then). Now I am back at it for real. We
    > did infact work with cookies, but I only vaguely remember
    > how to set/read them. Would have any sample syntax or
    > point me where I could see some examples? JS/vbs either
    > or.
    >
    > Thanks again for your reply.
    >
    > Rich
    >
    >
    > >-----Original Message-----
    > >have the login place a cookie/session variable...check
    > for it...if it's not
    > >there redirect
    > >
    > >--
    > >----------------------------------------------------------
    > >Curt Christianson (Software_AT_Darkfalz.Com)
    > >Owner/Lead Designer, DF-Software
    > >[url]http://www.Darkfalz.com[/url]
    > >---------------------------------------------------------
    > >...Offering free scripts & code snippits for everyone...
    > >---------------------------------------------------------
    > >
    > >
    > >"Rich" <rpng123aol.com> wrote in message
    > >news:4e8f01c3765f$6887b240$a401280aphx.gbl...
    > >> Hello,
    > >>
    > >> I need users to access a data entry asp page via a login
    > >> page. If they bookmark the data entry asp I want to
    > >> redirect them to the login page (using IIS). Here is
    > what
    > >> I had in mind:
    > >>
    > >> <% LANGUAGE=JScript %>
    > >> <HTML>
    > >> <HEAD>
    > >> <TITLE>Home Page</TITLE>
    > >> <script language="JavaScript">
    > >> function myFunction(s){
    > >> ...
    > >> location.href='insert.htm';}
    > >> </SCRIPT>
    > >> </HEAD>
    > >> <body onLoad="myFunction('<%Response.write(Request.Form
    > >> ("testfld"));%>')">
    > >> ...
    > >>
    > >> Isn't there some kind of authentication method for IIS,
    > or
    > >> at least a less kludgy way of doing this than what I
    > have
    > >> above? Just checking.
    > >>
    > >> Thanks,
    > >> Rich
    > >
    > >
    > >.
    > >

    Curt_C [MVP] Guest

  5. #5

    Default Re: best way to redirect asp to login htm page?

    Hey rich, does your login page submit straight to the data entry page?

    If so then at the start of the data entry page you could just check that one
    of the fields from your login page actually has data in it, and if it
    doesn't then redirect the user back there.

    so put this at thge start of your data entry page..

    <%
    if request.form("yourformfield")="" then

    response.write "<script>alert('you must come here from the login
    page.')</script>";
    response.redirect "login.htm"

    else
    'show the data entry page


    end if

    %>

    hoope this helps

    dave



    "Rich" <rpng123aol.com> wrote in message
    news:4e8f01c3765f$6887b240$a401280aphx.gbl...
    > Hello,
    >
    > I need users to access a data entry asp page via a login
    > page. If they bookmark the data entry asp I want to
    > redirect them to the login page (using IIS). Here is what
    > I had in mind:
    >
    > <% LANGUAGE=JScript %>
    > <HTML>
    > <HEAD>
    > <TITLE>Home Page</TITLE>
    > <script language="JavaScript">
    > function myFunction(s){
    > ...
    > location.href='insert.htm';}
    > </SCRIPT>
    > </HEAD>
    > <body onLoad="myFunction('<%Response.write(Request.Form
    > ("testfld"));%>')">
    > ...
    >
    > Isn't there some kind of authentication method for IIS, or
    > at least a less kludgy way of doing this than what I have
    > above? Just checking.
    >
    > Thanks,
    > Rich

    Dave Mitchell Guest

  6. #6

    Default best way to redirect asp to login htm page?

    Thank you all for your responses. This really helps me
    out. I actually know how to do this stuff in JSP, but I
    don't want to use Tomcat because I am all hooked up with
    IIS/SqlServer now. My vbscripting is weak, at best. Oh
    well. I will be hanging around here a lot :).

    Thanks again,
    Rich
    >-----Original Message-----
    >Hello,
    >
    >I need users to access a data entry asp page via a login
    >page. If they bookmark the data entry asp I want to
    >redirect them to the login page (using IIS). Here is
    what
    >I had in mind:
    >
    ><% LANGUAGE=JScript %>
    ><HTML>
    ><HEAD>
    ><TITLE>Home Page</TITLE>
    ><script language="JavaScript">
    >function myFunction(s){
    >....
    > location.href='insert.htm';}
    ></SCRIPT>
    ></HEAD>
    ><body onLoad="myFunction('<%Response.write(Request.Form
    >("testfld"));%>')">
    >....
    >
    >Isn't there some kind of authentication method for IIS,
    or
    >at least a less kludgy way of doing this than what I have
    >above? Just checking.
    >
    >Thanks,
    >Rich
    >.
    >
    Rich Guest

  7. #7

    Default Re: best way to redirect asp to login htm page?

    Rich, how about this? A friend of mine found this (or invented it).
    Put it in your global.asa file in the Session_OnStart routine.

    ' If someone initially tries to load any page other than the
    ' start page, redirect them.
    ' NOTE - If the redirect happens, the rest of this function
    ' is not executed, so be sure this is LAST!

    Session("requestedPage") = Request.ServerVariables("SCRIPT_NAME")
    if not (STRCOMP(Application("StartPage"), Session("requestedPage"),
    vbTextCompare)=0) then
    Response.Redirect Application("StartPage")
    end if

    Works for me. No cookies (other than ASP's own). Just set
    Application("StartPage") to "login.asp" (or whatever you're using) in
    your Application_OnStart routine.

    Tom

    On Tue, 9 Sep 2003 07:52:56 -0700, "Rich" <rpng123aol.com> wrote:
    >Thank you all for your responses. This really helps me
    >out. I actually know how to do this stuff in JSP, but I
    >don't want to use Tomcat because I am all hooked up with
    >IIS/SqlServer now. My vbscripting is weak, at best. Oh
    >well. I will be hanging around here a lot :).
    >
    >Thanks again,
    >Rich
    >
    >>-----Original Message-----
    >>Hello,
    >>
    >>I need users to access a data entry asp page via a login
    >>page. If they bookmark the data entry asp I want to
    >>redirect them to the login page (using IIS). Here is
    >what
    >>I had in mind:
    >>
    >><% LANGUAGE=JScript %>
    >><HTML>
    >><HEAD>
    >><TITLE>Home Page</TITLE>
    >><script language="JavaScript">
    >>function myFunction(s){
    >>....
    >> location.href='insert.htm';}
    >></SCRIPT>
    >></HEAD>
    >><body onLoad="myFunction('<%Response.write(Request.Form
    >>("testfld"));%>')">
    >>....
    >>
    >>Isn't there some kind of authentication method for IIS,
    >or
    >>at least a less kludgy way of doing this than what I have
    >>above? Just checking.
    >>
    >>Thanks,
    >>Rich
    >>.
    >>
    Tom Bates Guest

Similar Threads

  1. Question redirect on login
    By Kirkman in forum Brainstorming Area
    Replies: 0
    Last Post: June 27th, 08:47 PM
  2. redirect to originally requested page after login
    By JoeyTMann in forum Coldfusion - Advanced Techniques
    Replies: 10
    Last Post: October 26th, 06:11 PM
  3. Login redirect back to previous page
    By Glen T in forum Coldfusion Database Access
    Replies: 2
    Last Post: September 18th, 11:33 PM
  4. Forms Authentication won't redirect to login page
    By Max Figueredo via .NET 247 in forum ASP.NET Security
    Replies: 1
    Last Post: September 26th, 07:50 PM
  5. Login User and Redirect to a specific page - help required
    By Alex Billerey in forum Macromedia Dreamweaver
    Replies: 1
    Last Post: July 22nd, 12:18 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139