Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

PedroDomingues10

Link em imagem (Sintaxe certa) no ASP

Recommended Posts

aoOow galera

to precisando mt coloca o link das paginas do site q eu estou fazendo nas imagens

o site eh de imobiliaria e na vitrine dos imoveis preciso q ao inves de o usuario clicar em ver detalhes ele apenas clica na imagem do imovel

 

segue o codigo da pagina:

 

<body>
<table width="100%" border="0" style="text-align:center">
		
		<%
		 if rsPegaImoveis.eof then
			Response.Write "<tr><td>"
			Response.Write "<div style='text-align:center; font:8pt Verdana, Arial, Helvetica; color:#666666;'>"
			Response.Write "Não Existe Imóveis Cadastrados<br>no Sistema"
			Response.Write "</div></td></tr>"
		 else
			rsPegaImoveis.pagesize = 9
			if request.QueryString("pagina")<>"" and Cint(request.QueryString("pagina")) > 0 and Cint(request.QueryString("pagina")) <= rsPegaImoveis.PageCount then 
				pagina = Cint(request.QueryString("pagina")) 
			else
				pagina = 1
			end if	
			rsPegaImoveis.absolutepage = pagina
		
		
		 sub montaLinha( data )
			
		 	Response.write "<tr>"
			for k = 0 to 2 
				if data.exists(k)  then
					Response.write "<td><div style='font:7pt Verdana, Arial; color:#666666; padding-top:2px;'>Código: "&data.item(k).item(0)&"</div></td>"
				else
					Response.write "<td> </td>"
				end if
			next
			Response.write "</tr>"
			
			Response.write "<tr>"
			for k = 0 to 2 
				if data.exists(k) then
					Response.write "<td  valign='top'><img src='"& data.item(k).item(1) &"' border='1' width='150' style='margin-top:3px;'></td>"
				else
					Response.write "<td> </td>"
				end if
			next
			Response.write "</tr>"
			
			Response.write "<tr>"
			for k = 0 to 2 
				if data.exists(k) then
					Response.write "<td>"&data.item(k).item(2)&"</td>"
				else
					Response.write "<td> </td>"
				end if
			next
			Response.write "</tr>"
		 	
		 end sub
		
		 i = 0
		 set j = CreateObject("Scripting.Dictionary")
		 dim t	
		
		 While not rsPegaImoveis.eof and ( i < 9 or i mod 3 <>0 )
			
			if i mod 3 = 0 and i > 0 then
				montaLinha j
				j.removeAll
			end if
			
			Set t = CreateObject("Scripting.Dictionary")
			if not rsPegaImoveis.eof then
				
				t.Add 0, cStr(rsPegaImoveis("Imovel_Codigo"))
				
				Set rsPegaFoto = Server.CreateObject("ADODB.Recordset")
				strPegaFoto = "SELECT * FROM ImovelImagens WHERE Imovel_ID="&rsPegaImoveis("Imovel_ID")

 

 

 

 

 

' AQUI ESTA O PROBLEMA quero colocar o link "<a href='descricao_imoveis.asp?idimovel="&rsPegaImoveis("Imovel_ID")&"'></a>" na linha ond esta t.add1."imagens_imoveis/"&rsPegaFoto("ImovelImagem")

 

'FICARIA ASSIM

"<a href='descricao_imoveis.asp?idimovel="&rsPegaImoveis("Imovel_ID")&"'>"imagens_imoveis/"&rsPegaFoto("ImovelImagem")</a>"

 

desse modo os links ficariam na imagem

mas essa sintaxe nao esta certa

 

 

rsPegaFoto.open strPegaFoto, conexao
				if not rsPegaFoto.eof then
	'==>	t.Add 1, "imagens_imoveis/"&rsPegaFoto("ImovelImagem")
				else 
					t.Add 1, "admin/imagens/nofoto_small.png"
				 end if 
				rsPegaFoto.close
				
				
				
				
				
				
				strImovelInfo =	"<div style='border:0px solid green;font:7pt Verdana, Arial; color:red;'><b>"&rsPegaImoveis("Imovel_Titulo")&"</b></div>" & _
								"<div style='border:0px solid #CCCCCC; padding-left:2px; text-align:left;  width:150px; height:90px; font:7pt Verdana, Arial;'>"
				
				'if not isLocacao then
					varValorImovel	= FormatCurrency(rsPegaImoveis("Imovel_ValorVenda"))
					'strImovelInfo	=	strImovelInfo &_
										
				'else
					varValorAluguel	= FormatCurrency(rsPegaImoveis("Imovel_ValorAluguel"))
					'strImovelInfo	=	strImovelInfo &_
										
				'end if
				
				strImovelInfo =	strImovelInfo &_
									"<b>Valor:</b> "&varValorImovel&"<br>" & _
									"<b>Valor Aluguel:</b> "&varValorAluguel&"<br>" & _
									"<b>Tipo:</b> "&rsPegaImoveis("Imovel_Descricao")&"<br>" & _
									"<b>Para:</b> "&rsPegaImoveis("Imovel_Transacao")&"<br>" & _
									"<b>Bairro:</b> "&rsPegaImoveis("Imovel_Bairro")&"<br>" & _
									"<b>Cidade:</b> "&rsPegaImoveis("Imovel_Cidade")&"<br>" & _
									"<b>Domitórios:</b> "&rsPegaImoveis("Imovel_Dormitorios")&"<br>" & _
									"<b>Suites:</b> "&rsPegaImoveis("Imovel_Suites")&"<br>" & _
									"<b>Vagas na Garagem:</b> "&rsPegaImoveis("Imovel_Garagem")&"<br>" & _
									"<div style='font:7pt Verdana, Arial, Helvetica; color:#333333; font-weight:bold; text-align:center; padding-top:2px; height:18px;'>"  & _
										"<a href='descricao_imoveis.asp?idimovel="&rsPegaImoveis("Imovel_ID")&"' style='color:#CC0000; text-decoration:none;'>Ver Detalhes</a>" & _
									"</div>" & _
								"</div>"
				
				
				t.Add 2, strImovelInfo
			else
			
				t.Add 0, false
				t.Add 1, false
				t.Add 2, false
				
			end if
			j.add (i mod 3), t
			rsPegaImoveis.MoveNext
			i = i + 1
			
		wend
		'montaLinha j
		Call montaLinha(j)
	 end if
	%>
	</table>
	</body>

 

 

preciso mt q esse link funicionee

c alguem puder me ajudar a colocar a sintaxe correta ou mostrar ond estou errando eu agradeçoo!!

 

 

vlws!!!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

o certo seria assim:

"<a href='descricao_imoveis.asp?idimovel="&rsPegaImoveis("Imovel_ID")&"'>imagens_imoveis/"&rsPegaFoto("ImovelImagem")&"</a>"

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.