[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

Adding a Column to an ASP Script and Deleting Some if Statements

Asked by coreybryant in Active Server Pages (ASP), Web Languages/Standards

Currently I have the script below that I am working with.  (I have not "updated" it to 'better' HTML yet, I just wanted to get this post out there.

Lines 4 - 11:
      if Rec("hotLink") = 1 then
            strRsp =  strRsp & "<font style=""font-size:16px"">"
            else
            strRsp =  strRsp & "<font style=""font-size:14px"">"            
      end if

      strRsp = strRsp & ("<a href="""& appUrl &"/links/"& Rec("linkID") & ".asp"">")
      strRsp = strRsp & (Rec("linkName") & "</a></font></b>" & vbnewline )

I really do not need, I just would like that to be an <h3> tag.   I know I could do:
      if Rec("hotLink") = 1 then
            strRsp =  strRsp & "<h3>"
            else
            strRsp =  strRsp & "<h3>"            
      end if

      strRsp = strRsp & ("<a href="""& appUrl &"/links/"& Rec("linkID") & ".asp"">")
      strRsp = strRsp & (Rec("linkName") & "</a></h3>" & vbnewline )

but I was hoping for something maybe a little bit cleaner if there are any ideas.

Right now, the code below creates two columns.  I would like to create three columns.

Basically broken down, the code creates something like:
<table style="width: 99%; border-collapse:collapse">
      <tr>
            <td style="width:60%; text-align:left">linkName</td>
            <td style="width:70px; text-align:right">image</td>
      </tr>
</table>

But I would like something like:
<table style="width: 99%; border-collapse:collapse">
      <tr>
            <td style="width:60%; text-align:left">linkName</td>
            <td style="text-align:left">sponsor</td>
            <td style="width:70px; text-align:right">image</td>
      </tr>
</table>


Thanks!

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
strRsp = strRsp & ("<table id=""tbl_func_dir144"" style=""border:0px; border-collapse:collapse; width:100%; text-align:right; background-color:#abcadc;"" cellspacing=""0"" cellpadding=""0"">" & VbCrLf)	
	strRsp = strRsp & ("<tr><td style=""padding:4px; border-bottom:1px #111111 solid; width:60%; background-color:#c3d9e6; text-align:right;"">" & vbNewLine )
	if Rec("hotLink") = 1 then 
		strRsp =  strRsp & "<h3>"
		else
		strRsp =  strRsp & "<h3>"		
	end if
 
	strRsp = strRsp & ("<a href="""& appUrl &"/links/"& Rec("linkID") & ".asp"">")
	strRsp = strRsp & (Rec("linkName") & "</a></h3>" & vbnewline )
	if Rec("hotLink") = 1 then 
	strRsp =  strRsp & "<font style=""font-size:8pt"">"		
	strRsp = strRsp & ("&nbsp;<sup>[<font color=""#cc0000"">sponsor</font>]</sup></font>")
	end if
 
	if Rec("submitDate") > date - 5 then	
		strRsp = strRsp &  "&nbsp;&nbsp;<img border=""0"" src="""& appUrl &"/images/new.gif"">"
	end if
 
	strRsp = strRsp & ("</td><td style=""padding:4px; border-bottom:1px #111111 solid; background-color:#c3d9e6; width:70px; text-align:right"">")
	strRsp = strRsp & (" <b>&nbsp;" & vbNewLine )
			if Rec("cVotes") = 0 then
				rating = 0 
			else
				rating = cint(Rec("Rating") / Rec("cVotes")) 
			end if
	strRsp = strRsp &  ("<a href=""javascript:openWindowRating('"& appUrl &"/rate.asp?linkID=" & Rec("linkID")& "')"">")
	strRsp = strRsp &  ("<img src="""& appUrl & "/images/star_"& rating & ".gif"" border=""0""></a>" & vbnewline)
 
	strRsp = strRsp & ("</td>" & vbnewline )
	strRsp = strRsp & ("</tr></table>" & vbnewline )
[+][-]09/10/09 10:44 AM, ID: 25302549Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/10/09 11:15 AM, ID: 25302829Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/10/09 11:20 AM, ID: 25302867Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/10/09 11:48 AM, ID: 25303096Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/10/09 12:21 PM, ID: 25303352Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/10/09 01:33 PM, ID: 25303981Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/11/09 07:20 AM, ID: 25309765Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625