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.
Adobe DreamweaverJavaScriptASP

Avatar of undefined
Last Comment
Scott Fell

8/22/2022 - Mon
SOLUTION
Jason C. Levine

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
leakim971

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Scott Fell

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.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23