target="I1" help!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hudbarnett
    New Member
    • Apr 2010
    • 2

    target="I1" help!!

    Hi all

    Hope someone can help me here.

    I have a website that i have added a search engine too, it searched results that i have stored into a database. I would really like it when a list of pages from the database is displayed, a user can click on one of them and it will open into an iframe called target="I1".

    Here is my code, it all works but i cannot get the target inserted so it works..

    Code:
    <%
    strSearch = Request.Form("search")
    
    If strSearch <> "" Then
    	Dim strConnect, SQL
    	Dim RS
    	strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("search.mdb") & ";"
    
    	SQL = "SELECT * FROM Sites WHERE INSTR(Sites.Description,'" & strSearch & "')"
    
    	Set RS = Server.CreateObject("Adodb.Recordset") 'Used for pulling main categories from DB
    	RS.Open SQL,strConnect
    
    	Do Until RS.EOF
    '<!-- I know the line below presents me with my search results but where would i add target="I1"	 -->	
    			Response.Write "<A HREF='http://" & RS("URL") & "'>" & RS("URL") &"</A> - " & RS("Name") & "<BR>"
    			Response.Write RS("Description") & "<BR><BR>"
    
    	
    		RS.MoveNext
    	LOOP
    	
    	RS.Close
    	
    End If
    
    %>
    I would like to thank you all in advance for any help given.

    Thanks

    Hud BArnett
    Last edited by jhardman; Apr 10 '10, 06:36 PM. Reason: please use code tags
  • GazMathias
    Recognized Expert New Member
    • Oct 2008
    • 228

    #2
    This is not specifically related to ASP, but rather just HTML. Anywho, target is just an attribute to the anchor tag:

    Code:
    <a href="http://some.url" target="SomeFrame">Some Site</a>
    Gaz.

    Comment

    • hudbarnett
      New Member
      • Apr 2010
      • 2

      #3
      Thanks for your reply. I have managed to get the code to work.. its like this

      Response.Write "<A HREF=""http://" & RS("URL") & """ target=""I1"">" & RS("URL") &"</A> - " & RS("Name") & "<BR>"

      Comment

      Working...