.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Removing the HTML wrapped around web parts?

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :SharePoint
I work with both SP 2007 and 2010 for WCM and this has always been a problem. Every web part or web part zone is almost always wrapped in at least one table and/or several divs. In 2010 I'm finding that even the XLV part is getting this wrapper. Besides being a lot of bloat that wastes bandwidth, it makes it much harder to customize the look and feel of the site. Is there a way to turn this off or modify the output? I don't care what it has to do for edit mode to make the UI function, but when serving pages to anonymous web surfers I'd like to eliminate the code. As an example, here's the beginning wrapper code for a CQWP in SP 2010. The actual content that needs to be displayed is a simple unordered list: <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td id="MSOZoneCell_WebPartWPQ1" valign="top" class="s4-wpcell-plain"> <table class="s4-wpTopTable" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top"> <div WebPartID="c0f138b4-3002-4e47-a797-e4cd1a2b23c1" HasPers="false" id="WebPartWPQ1" width="100%" class="ms-WPBody noindex" allowDelete="false" style="&qu

View Complete Post

More Related Resource Links

Removing HTML head code

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">


<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
 /* Font Definitions */
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
	panose-1:2 15 5 2 2 2 4 3 2 4;}
	panose-1:2 11 6 4 3 5 4 4 2 4;}

How to minify html , css , javascript ( removing white spaces etc )


i am looking for a tool which will minify my code when publishing website


or it may be run time minify too if not using too much cpu power



Connecting 2 user controls that are wrapped in web parts.


As i develop my SP Site, It seems to get more and more complicated lol. Ok, so I have 2 user controls that are in the Smart Part 1.3 web parts. They are ajax enabled and everything works. The Parent and Child controls are both hopped up gridviews. I want to be able to click the title (or some column in the row) and that will populate the other control. I have looked at the ICellProvider stuff but im not sure if that would work considering im using controls and not building actual web parts. What I have in mind is a CAML version if this:

Display all columns where Title = "Whatever was just clicked in the parent".



Compressing and Removing extra whitespace from generated HTML in MVC



In my .net MVC app I´ve added two filters of this page  http://stackoverflow.com/questions/855526/removing-extra-whitespace-from-generated-html-in-mvc/4074953:
- CompressFilter by WOPR
- WebWhitespaceFilterAttribute by alphus

In my Controlers I just added:

    public virtual ActionResult Index ()

But sometimes appears this error and the page is not returned.

    Content Encoding Error
    The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

I think the problem is by using both actions.
Is there a better way to do it?
Myabe joining both actions into one?

I try to join both Actions but with this code I got the same Content Encoding Error in all my pages:

#region OnActionExecuting
    /// <summary>
    /// OnActionExecuting code
    /// </summary>
    /// <param name="filterContext">The filter context</param>
    public override void OnActionExecuting ( ActionExecutingCont

problem with using regex removing html tag attributes


hi,all, I have the following code:

wstring myapp::PreProcessingTagStr(wstring wstrHtmlSrc)
	const wregex wregPattern(L"\\s*<([a-z][a-z0-9]*)[^>]*?(/?)>.*?</([a-z][a-z0-9]*)>\\s*");
	const wstring replacer = L"<$1$2>T";
	return regex_replace(wstrHtmlSrc, wregPattern, replacer);

void myapp::OnBnClickedTestButton5()
	// TODO: Add your control notification handler code here

	wstring wstrTxt = L"<SPAN class=scndInfo>(Hayes., UK, United Kingdom)</SPAN>";
	m_strVIPSResult += CString(L"") + PreProcessingTagStr(wstrTxt).c_str();

and it supposes to generate something like:


but the regex matches nothing, it just gives out the original string "

remove unwanted parts of a string of html tags


hi,all, I have a string of tags like:

<A href

ASP.NET, HTML, JavaScript Snippet Support (VS 2010 and .NET 4.0 Series)

This post covers another useful improvement in VS 2010 - HTML/ASP.NET/JavaScript snippet support. Snippets allow you to be more productive within source view by allowing you to create chunks of code and markup that you can quickly apply and use in your application with a minimum of character typing.

Visual Studio has supported the concept of "snippets" for VB and C# in previous releases - but not for HTML, ASP.NET markup and JavaScript. With VS 2010 we now support snippets for these content types as well.

Displaying SharePoint lists in Web Parts

When you create a built-in or custom list in Microsoft Windows SharePoint Services, Windows SharePoint Services creates a Web Part, a basic building block of a SharePoint site, to display that list. These Web Parts are called List View Web Parts. Windows SharePoint Services stores List View Web Parts in the site collection Web Part gallery. (The site collection Web Part gallery is the most central gallery of Web Parts for a work group. By default, the gallery name is the name of the site, such as "Our Team Site Web Part Gallery." )

Six easy ways to customize your site using Web Parts in SharePoint

Becoming familiar with Web Part customization techniques gives you a range of page-customization choices. For example, you can customize your site's home page so that it displays the specific information that your team needs. You can rearrange the list items on the home page, add lists, and even change the images on the home page. As you become more familiar with Web Part Page customization techniques, you can build interactive Web Part Pages that makes the data in lists more dynamic and useful, and you can add new Web Parts that provide access to external data and Web services.

SharePoint Tutorial - Web Parts

A page in SharePoint is comprised of web parts the exist within zones. Web parts are available for just about everything. For example in the page below there are four web part highlighted by different colors. The purple web part displays a short list of the new announcements stored in the annoucements library. The pink web part displays events from a calendar within the site. The green web part displays an image from a location the user specifies. The gray web part displays a list of links from the links list on the site.

Maintain HTML Radio Button Selection Inside GridView After Postback

Long time ago I wrote an article about getting the value of the selected RadioButtons inside the GridView control. The code did not addresssed the postback issue which means that the selected radio button was cleared after the postback occurs.

Visual Studio Add-In for Web Parts Generation

This article will introduce you to a new Visual Studio 2005/2008 add-in that can be used for Web Parts generation based on a prepared ASCX control/template. The add-in should allow Web Part developers to easily make Web Parts using the Visual Studio HTML designer. It should save you a lot of time and make Web Part development an enjoying experience even for beginners.

This article is written in the form of a step-by-step tutorial. It will give beginners a chance to successfully make, deploy, and try their first Web Parts, and will save some time for advanced users as you can always run into challenges when working with SharePoint.

Rendering ASP.NET Script References into the Html Header

One thing that I've come to appreciate in control development in ASP.NET that use JavaScript is the ability to have more control over script and script include placement than ASP.NET provides natively. Specifically in ASP.NET you can use either the ClientScriptManager or ScriptManager to embed scripts and script references into pages via code.

Sandboxed Solutions for Web Parts in SharePoint 2010

SharePoint 2010 provides a new sandboxed environment that enables you to run user solutions without affecting the rest of the SharePoint farm. This environment means that users can upload their own custom solutions without requiring intervention from administrators, and without putting the rest of the farm at risk.

Writing Custom Web Parts for SharePoint 2007

As I mentioned in an earlier blog post, SharePoint 2007 is built on top of ASP.NET 2.0, which means you can now use ASP.NET 2.0 features (Forms Authentication, Master Pages, Membership, Site Navigation, New Data Controls, etc) when building SharePoint sites. This is true for both the new Windows SharePoint Services 3.0 version (which will be a free download) as well as Microsoft Office SharePoint Server 2007 (which costs money).

Checklist for Creating SharePoint Web Parts

Use this checklist to assist with the deployment and maintenance of Microsoft SharePoint Products and Technologies Web Parts.

Viewing Reports with SharePoint 2.0 Web Parts

Reporting Services provides several Web Parts that work with specific versions of a report server and in particular deployment modes. If you want to access report server content on a SharePoint site from a native mode report server, use the SharePoint 2.0 Web Parts that are included with Reporting Services. Instructions for installing and using the 2.0 Web Parts are provided in this topic.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend