This topic is locked

Link to Record (Edit)

7/28/2006 12:51:21 PM
ASPRunnerPro General questions
J
jar author

I would like to create a link from "Products_list.asp page" to "Product_Description_Edit.asp" so when the link is clicked it takes you to the same record in the target table but in edit mode.
Jar

J
Jane 7/31/2006

Jar,
you can do the following:

  1. set Products as master table for the Product_Description table and then proceed to the events tab and add following code to the ListOnLoad event for the Product_Description table:
    Sub ListOnLoad(strSQL)

    Set rsTemp = server.CreateObject("ADODB.Recordset")

    rsTemp.open strSQL, dbConnection

    %>

    <script>

    window.location='Product_Description_edit.asp?editid=<%=rsTemp("ProductID")%>';

    </script>

    <%
    End Sub



where ProductID is your actual field name.
2. or you can edit generated files manually.

Open ..._list.asp file, find looprs function, locate following code snippet:

return false;" >Edit</a>

<% end if %>

&nbsp;</td>

and add this code after it:

<a href="Product_Description_edit.asp?editid=<%=rs("ProductID") %>">Description</a>

J
jar author 8/1/2006



Jar,
you can do the following:

  1. set Products as master table for the Product_Description table and then proceed to the events tab and add following code to the ListOnLoad event for the Product_Description table:
    where ProductID is your actual field name.
  2. or you can edit generated files manually.

    Open ..._list.asp file, find looprs function, locate following code snippet:

    and add this code after it:


Jane:
I manually edited the ASP page and the link works. The link takes me to the record in edit mode but when I make a change to the record and click save, the changes do not get saved.
Jar
[

quote name='jar' date='Jul 28 2006, 11:51 AM' post='10099']

I would like to create a link from "Products_list.asp page" to "Product_Description_Edit.asp" so when the link is clicked it takes you to the same record in the target table but in edit mode.
Jar

[/quote]

J
Jane 8/2/2006

Sorry for my fault.

Here is the correct code:

<a href="Product_Description_edit.asp?editid=<%=rs("ProductID") %>&todo=view">Description</a>