Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP tear

Status
Not open for further replies.

biry

Technical User
Nov 5, 2004
127
CA
Hi, i'm trying out the object of SOFTWING.ASPtear

I got it working but was wondering if it were possible to display the torn page without displaying certain parts of the page, i guess basically i was wondering if the page can be reformatted to a degree

I've been trying to find some sort of refernces to start me on my way but am having no luck.
 
Yes it is perfectly possible however it may be quite difficult to implement complicated formatting changes.
Once ASPTear has retrieved the page it is simply a string object. Therefore you can use any string manipulation functions you wish to, in essence, rewrite the html before it is written to the client.

I don't think you will ever find any references for this sort of thing as every single implementation will be completely different.
 
what do you mean by string manipulation functions, can you give an example?
 
sorry, i'm lost and new at this. lets say the html written in the sting to the client displays the page, how could i have it omit the section wich follows this:
so in the html that is written for the client, how can i have it so that the information at the begining is omitted, so the client doesn't see it:

the part to omit is after this:
</head>

<body link="#333366" vlink="#666699">
<div align="center">

And this is the part i wish to omit:
Code:
<FORM NAME="bcform" METHOD="get" ACTION="/custom/painewebber-com/nav.asp">

		<INPUT TYPE="hidden" NAME="o_symb" VALUE="IBM">
		<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="424" BGCOLOR="#000066">
			<TR><TD COLSPAN=4 ><img src="images/trans.gif" height=6 WIDTH="424" border=0 alt=""></TD></TR>
			<TR>
				<TD><IMG SRC="images/trans.gif" WIDTH="10"></TD>	
				<TD NOWRAP><FONT FACE="Arial,Helvetica,sans-serif" SIZE="-4" COLOR="#FFFFFF">Select From</font><br>
					<SELECT NAME="service">
						<OPTION VALUE="1">Quote & News
						<OPTION VALUE="2">Interactive Charting
						<OPTION VALUE="3">MultiQuote
						<OPTION VALUE="4">Market Summary
						<OPTION VALUE="5">CBS MarketWatch News
						<OPTION VALUE="7" SELECTED>Comtex News
					</SELECT>
				</TD>
				<TD NOWRAP >
					<FONT FACE="Arial,Helvetica,sans-serif" SIZE="-4" COLOR="#FFFFFF">Enter Symbol or Keywords:</FONT><br>
					<input type="text" name="symb" VALUE="IBM" size="20" maxlength="30">  
				</TD>
				<TD VALIGN="TOP" NOWRAP ><FONT FACE="Arial,Helvetica,sans-serif" SIZE="-4" COLOR="#666666"><br></FONT><input type="submit" value="Show">  </TD>		
			</TR>
			<TR><TD COLSPAN=4 ><img src="images/trans.gif" height=6 WIDTH="424" border=0 alt=""></TD></TR>
			<tr bgcolor="#FFFFFF"><td align=right valign=top colspan=4><a href="[URL unfurl="true"]http://www.bigcharts.com"><img[/URL] src="images/provided-by-bc.gif" width=161 height=16 alt="Provided by BigCharts.com" border=0></a></td></tr>
<TR><TD COLSPAN=4 BGCOLOR="#FFFFFF"><img src="images/trans.gif" height=15 WIDTH="424" border=0 alt=""></TD></TR>
			<TR><TD COLSPAN=4 BGCOLOR="#FFFFFF"><img src="images/trans.gif" height=15 WIDTH="424" border=0 alt=""></TD></TR>
			
		</TABLE>
 
String manipulation functions are like: Left(), Mid(), Right(), InStr(), InStrRev, Trim(), LTrim(), etc etc

VB is pretty handy with string manipulation.

Suppose you wanted to remove the first form in an HTML page that was stored in a string.

Dim startPosition, endTagStart, endPosition
startPosition = InStr(strHTMLPage, "<FORM")
endTagStart = Instr(strHTMLPage, "</FORM")
endPosition = Instr(strHTMLPage, ">", endTagStart)

strHTMLPage = Left(strHTMLPage, startPosition -1) & Mid(strHTMLPage, endPosition +1)

Response.Write strHTMLPage
 
ok i think i get this kinda using

Dim sFileExt
sFileExt = strRetval
sFileExt = Left(strRetval, 3667)
Response.Write sFileExt

i have display the last 3667 character in the string, How could i eliminate the first 3667 characters in the string?

thanks
 
If you just want to cut off the first 3667 characters and then display the rest of the string then use the Mid() function.
 
sFileExt = mid(strRetval, 3668)

That will remove the first 3667 characters
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top