This topic is locked

_list.asp questions

11/4/2004 9:38:21 AM
ASPRunnerPro General questions
D
dpkona author

(1) I'm working on a certain application that lists dollars by account. I don't want users to be able to edit the salary accounts. How can I remove the edit link on the list page for those accounts. I tried changing some of the code around the return false;">Edit<</a> string but no go.
(2) I would also like to format the results of one of my pages into %, but there is no format option for percent.
(3) I have one security table that works great. I have added certain links off of my main _list.asp page that I would like the same security to follow. Is there a way to do that?

Sergey Kornilov admin 11/4/2004
  1. To remove Edit link simply open project file in ASPRunner and uncheck Edit page checkbox on the Key column tab in ASPRunner.
  2. Percent formatting option will be added in one of the following versions.
  3. To protect other ASP pages from unauthorized access simply add the following section in the beginning of each ASP file:
    <%

    If Session("UserID")="" then

    Response.Write "<p>Your session has expired. Please <a href=""login.asp"">login</a> again</p>"

    Response.End

    End If

    %>

D
dpkona author 11/4/2004

(1) If I uncheck the key column then users will not be able to edit any of the accounts....i want them to be able to edit only certain accounts....for example on the _list.asp page if you have the following accounts listed....salaries, overtime, travel, rent, utilities, etc....i don't want them to be able to edit salaries but i do want them to be able to edit the rest...basically in the _list.asp page there would be no edit option next to the salary account ...but it would be visible on overtime, travel, rent. utilities, etc...
(2) thanks
(3) I want the security on the first _list.asp page to carry forward ...in other words if i limit the user to 3 cost centers then when they go a page i added i want them limited to the same 3 cost centers without having to re-login...

D
dpkona author 11/5/2004

There has to be a way in the following code from the _list.asp page that does the following while still showing the record on the list page:
If("Account") = 600000 then
message="<div class=message><<<Can't update Record >>></div>"
<a href="Query1_edit.asp"
onClick="java script: document.forms.editform.TargetPageNumber.value=<%=mypage%>; document.forms.editform.editid.value = '<%=EscapeQuotes(rsData(strKeyField))%>';<% if strKeyField2<>"" then %> document.forms.editform.editid2.value = '<%=EscapeQuotes(rsData(strKeyField2))%>';<% end if %><% if strKeyField3<>"" then %> document.forms.editform.editid3.value = '<%=EscapeQuotes(rsData(strKeyField3))%>'; <% end if %>document.forms.editform.action.value = 'view';document.forms.editform.submit(); return false;" >Edit</a>

501105 11/5/2004

got it in case anyone ever wants to do this
<% if (rsDetails.Fields("Yourfield").Value)<>somevalue then %>
this will take away the edit link on the _list.asp page
i've created a budget application that lists accounts by fiscal period
and the salary field is calculated using an internal software program so
there is no need for the user to edit