Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Remove Last Updated Message on Web Capture WebPart

  Asked By: Dario    Date: Jun 14    Category: Sharepoint    Views: 1546

Well after some looking I was unable to find anyone that has removed
the "Web Capture last updated at.." message from the capture web
part. So decided that I would try and tackle this one.

The capture part works by requesting the captured page using
Microsoft.XMLHTTP. It then post the results to an aspx page in the
_wpresources directory. That aspx page in turn uses
WebCaptureWebPart.ClipAndRenderClientCapturedContent to trim the
content down to the requested table. The
ClipAndRenderClientCapturedContent method uses an httpwriter to
write the necessary content to the response.output.

My approach was to keep the method
ClipAndRenderClientCapturedContent from writing directly to
reponse.output and instead substitute my own httpwriter. Then get
the content that was written to it, remove the updated message and
write that to the response.output.

The aspx page that you need to change is called wccapture.aspx you
will find it in the directory \Program Files\Common Files\Microsoft
Shared\web server
extensions\wpresources\Microsoft.Office.DataParts\11.0.0.0__71e9bce11
1e9429c

Change the following lines in the method RenderCapture()

//HtmlTextWriter writer = new HtmlTextWriter(Response.Output);
StringBuilder renderedOutput = new StringBuilder( );
StringWriter strWriter = new StringWriter(renderedOutput);
HtmlTextWriter writer = new HtmlTextWriter(strWriter);
captureResult = WebCaptureWebPart.ClipAndRenderClientCapturedContent(
Context,writer,Request.InputStream, contentType
[0],cacheControlHeader,
Capturer.ContentLink,Capturer.RenderTags,
Capturer.RenderTagIndexes,Capturer.Dir);

CompareInfo comp = CultureInfo.InvariantCulture.CompareInfo;

string modifiedOutput = strWriter.GetStringBuilder().ToString();
int firstTR = comp.LastIndexOf
(modifiedOutput,"<tr>",CompareOptions.IgnoreCase);
int length = modifiedOutput.Length;
int lastTR = comp.LastIndexOf
(modifiedOutput,"</tr>",CompareOptions.IgnoreCase);
modifiedOutput = modifiedOutput.Remove(firstTR,length-firstTR-
(length-lastTR)+5);

Response.Output.Write(modifiedOutput);

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Remove Last Updated Message on Web Capture WebPart Or get search suggestion and latest updates.




Tagged: