Is there any easy way to display from a starting point Like say, I use iframe but I do not want to display first 20% of the url. Has anybody faced this kind of problem before? How did you fix it ?
you dont want to show the first 20% of the URL or the actual page? Are you just trying to disguise the URL to prevent people from looking at the source and seeing it is offsite content?
You may be able to crop an image. I do not think you are going to be able to crop a frame containing html. I will think about this some more. Q...
You still havent clarified if it is the page you are trying to trim or the pages URL. One option is to screenscrape the page you are wanting into a string. Trim the parts you dont want off and then present this to the viewer. You will need to make sure any images or links are absolute rather than relative otherwise they will not work.
Let me provide more clarifications Suppose domain.com has a page like <img> </img> <header> content Code (markup): I want to do <iframe src="domain.com"> but only want to show the content not img or header.
ok, so it is the page rather than the url you want to trim. I assume you dont control the other page's content and want to completely remove the other part of the document rather than just have it scrolled up. In which case screen scraping and removing the unwanted element would work but depending on how stable the point it is to start from is will dictate on how much effort it will require to maintain (eg if it is only the header you want to remove then it is easy, if it is a point in the middle of the document there is more risk involved) If there are links or images off the page you are loading then again there is more work to do. A very crude but workable version of just getting the content between the <body> tags is below. If you called the file "body.aspx" then your iframe would simpy be <iframe src="body.aspx" /> <%@ Page Language="VB" %> <%@ Import Namespace="system.net" %> <%@ Import Namespace="system.io" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Dim client As New WebClient Try Dim results As String = client.DownloadString("http://www.domain.com/") results = results.Substring(0, results.IndexOf("</body")) results = results.Substring(results.IndexOf("<body"), results.Length - results.IndexOf("<body")) results = results.Substring(results.IndexOf(">") + 1, results.Length - (results.IndexOf(">") + 1)) outputLT.Text = results Catch wex As WebException 'Something went awry in the HTTP request! Finally client.Dispose() End Try End Sub </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <asp:Literal ID="outputLT" runat="server" /> </body> </html> Code (markup): To deal with links or images you can either make them absolute or add further screenscraping to hide the fact they are offsite