This topic is locked

Master Detail link incorrect

11/30/2004 1:52:13 PM
ASPRunnerPro General questions
J
joost author

Hi,
Found a small bug. We have SQL Server 2000.
Have created a Master Detail relationship.
The link "Back to Master Table" is incorrect. It links to

http://.........../dbo.tblCostComponent_list.asp


Instead of to

http://............/tblCostComponent_list.asp


Would be great if it can be fixed as well.
Thanks again.
Joost

D
dheydt 12/3/2004

I'm getting the same problem. I didn't have this problem with the demo version (which was 3.0 I believe) and we just purchased this and I uploaded the latest version 3.1.
Is there a fix for this?
I'm just now working on modifications to the template files but plan to build quite a few pages when I'm done. It would be a real pain if I need to go and modify every page manually to make this work.
Please help! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=2875&image=1&table=forumreplies' class='bbc_emoticon' alt=':unsure:' />

D
dheydt 12/6/2004

For anyone else having this problem, I've developed a "work-around" solution. It basically just removes the "dbo." part of the name in the URL if it exists.
The code you will need to replace is in the list.asp file in your template. Search for the text ##MASTERTABLEURL##
You should find a section of code that looks like this...

   <% If strMasterKey<>"" Then

   'Session(strTableName & "SQL") = Session(strTableName & "MasterSQL")

   %>

   <form method="POST" action="##MASTERTABLEURL##_list.asp" name="master" id="master">

   <input type=hidden id="TargetPageNumber" name="TargetPageNumber" value="<%=Request.Form("masterTargetPageNumber")%>" >

   <input type=hidden id="cmdGotoPage" name="cmdGotoPage" value="GotoPage">

   <input type=hidden id="action" name="action" value="backtomaster">

   </form>

   

   <td align=center>

     <a href=##MASTERTABLEURL##_list.asp onClick="document.forms.master.submit(); return false;">Back to Master table</a>

   </td>

   <td width=20>&nbsp;</td>

   <%End If%>


You will want to replace this code with this...

   <% If strMasterKey<>"" Then

   'Session(strTableName & "SQL") = Session(strTableName & "MasterSQL")

   

   strMasterURL = Replace("##MASTERTABLEURL##_list.asp","dbo.", "")

   Response.Write("    <form method=" + Chr(34) + "POST" + Chr(34) + " action=" + Chr(34) + strMasterURL + Chr(34) + " name=" + Chr(34) + "master" + Chr(34) + " id=" + Chr(34) + "master" + Chr(34) + ">" + vbCrLf)

   Response.Write("    <input type=hidden id=" + Chr(34) + "TargetPageNumber" + Chr(34) + " name=" + Chr(34) + "TargetPageNumber" + Chr(34) + " value=" + Chr(34) + Request.Form("masterTargetPageNumber") + Chr(34) + " >" + vbCrLf)

   Response.Write("    <input type=hidden id=" + Chr(34) + "cmdGotoPage" + Chr(34) + " name=" + Chr(34) + "cmdGotoPage" + Chr(34) + " value=" + Chr(34) + "GotoPage" + Chr(34) + ">" + vbCrLf)

   Response.Write("    <input type=hidden id=" + Chr(34) + "action" + Chr(34) + " name=" + Chr(34) + "action" + Chr(34) + " value=" + Chr(34) + "backtomaster" + Chr(34) + ">" + vbCrLf)

   Response.Write("    </form>" + vbCrLf)

   Response.Write(" " + vbCrLf)

   Response.Write("    <td align=center>" + vbCrLf)

   Response.Write("      <a href=" + Chr(34) + strMasterURL + Chr(34) + " onClick=" + Chr(34) + "document.forms.master.submit(); return false;" + Chr(34) + ">Back to Master table</a>" + vbCrLf)

   Response.Write("    </td>" + vbCrLf)

   Response.Write("    <td width=20>&nbsp;</td>" + vbCrLf)

   

   End If%>


After you rebuild your page(s) the "dbo." will no longer show in the link. As far as I can tell this will not affect pages that do not have the "dbo." problem but please post here if you find out something different.
Dan <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=2889&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' />

Sergey Kornilov admin 12/7/2004

Fixed.
Please download update here: http://www.asprunner.com/files/asprunnerpro31a.exe

J
joost author 12/9/2004

Thanks again. works good now.

501112 12/10/2004

Hi.

I had the same problem and solve it other way.

There are only 2 places where "##MASTERTABLEURL##" is used in the list

I just replaced at those plases with this:

<%=replace("##MASTERTABLEURL##","dbo.","")
-----------------------------------------------------------------------------------------

<form method="POST" action="<%=replace("##MASTERTABLEURL##","dbo.","")%>_list.asp" name="master" id="master">

-----------------------------------------------------------------------------------------

<a href=<%=replace("##MASTERTABLEURL##","dbo.","")%>_list.asp onClick="document.forms.master.submit(); return false;">Back to Master table</a>

-----------------------------------------------------------------------------------------
It looks simpler to me..