asp(scripting)
-
i m displaying records from one table and while displaying i m passing the id field of project.asp to scheme.asp now my problem is that when scheme.asp does not contain the scheme for the project.asp then it should not show the hyperlink viewscheme on project.asp file. here is my code.....below
<% opendatabase conn id=request("id") sql="select * from projectdescription where id="& id set obj=server.createobject("adodb.recordset") obj.open sql,conn,1,1 sql2="select * from schemedescription where projectid="& obj("id") set obj2=server.CreateObject("adodb.recordset") obj2.open sql,conn,1,1 if obj2("projectid")=obj("id") then response.Write("[View Project](project.asp?id=" & obj("id") & ") ") response.Write("[View Scheme](scheme.asp?id=" & obj("id") & ") ") response.Write("[View Team](team.asp?id=" & obj("id") & ")
") %><% response.Write(obj("description")) %>
" height="150" width="200" alt="Central Home Images" > <% else response.Write("[View Project](project.asp?id=" & obj("id") & ") ") response.End() end if %>
-
i m displaying records from one table and while displaying i m passing the id field of project.asp to scheme.asp now my problem is that when scheme.asp does not contain the scheme for the project.asp then it should not show the hyperlink viewscheme on project.asp file. here is my code.....below
<% opendatabase conn id=request("id") sql="select * from projectdescription where id="& id set obj=server.createobject("adodb.recordset") obj.open sql,conn,1,1 sql2="select * from schemedescription where projectid="& obj("id") set obj2=server.CreateObject("adodb.recordset") obj2.open sql,conn,1,1 if obj2("projectid")=obj("id") then response.Write("[View Project](project.asp?id=" & obj("id") & ") ") response.Write("[View Scheme](scheme.asp?id=" & obj("id") & ") ") response.Write("[View Team](team.asp?id=" & obj("id") & ")
") %><% response.Write(obj("description")) %>
" height="150" width="200" alt="Central Home Images" > <% else response.Write("[View Project](project.asp?id=" & obj("id") & ") ") response.End() end if %>
I think you need to omit this response.Write("scheme.asp?id=%22%20&%20obj(%22id%22)%20&%20%22") Use an IF statement then.. .whats the problem ?? :confused::confused:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Microsoft Bing MAP using Javascript
CLR objects in SQL Server 2005
Uncommon C# Keywords/xml>