Link to home
Start Free TrialLog in
Avatar of slegy
slegy

asked on

Summary to Detail Page using a Button

I have a summary page which lists events, each with a unique ID. Currently, the user can click on "Edit" and be taken to the detail page to edit the event. What I would like to do is replace "Edit" with a button that goes to a routine which checks to see if the user is logged in before going to the detail page. I'm using Dreamweaver CS4. Is that possible?

Here is the code for the current "Edit" button:

<td width="20" class="hpResults"><div align="center"><a href="eventupdate.asp?ID=<%=(rseventCalendar.Fields.Item("ID").Value)%>"><span class="eventeditLink">Edit</span></a></div></td>

Open in new window


I tried saving the ID but was not successful.
SOLUTION
Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Are you using dreamweaver's code to log in?  If you are, then you can use the Server Behavior > User Authentication > Restrict Access to Page.  

You will end up with some type of code that looks like
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers=""
MM_authFailedURL="good_by_not_logged_in.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
  If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
         (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    MM_grantAccess = true
  End If
End If
If Not MM_grantAccess Then
  MM_qsChar = "?"
  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  MM_referrer = Request.ServerVariables("URL")
  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
  Response.Redirect(MM_authFailedURL)
End If
%>

Open in new window

Make sure that is on the very top of your detail page.