.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

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

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :ASP.Net

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



View Complete Post

More Related Resource Links

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.

Combine, minify and compress JavaScript files to load ASP.NET pages faster

Websites are getting more interactive these days and most of this interactivity comes from JavaScript. People are using different JavaScript libraries and frameworks to make their websites more interactive and user friendly.

Re-positioning an HTML container with javascript onresize with a Master page.


I have an HTML <div> container that I float to the right of a gridview.  When the browser window is maximized, it looks fine.  When minimized, the gridview positions below the floating container and most of the data is pushed off the bottom of the browser - you have to scroll down to see it.

If I position the floating container above the gridview it looks fine in a minimized window, but looks real bad when maximized.

What I want to do is use a javascript: onresize event to re-position the floating container up or down depending on the window.inner.width AND do it with a Master/Content page structure AND do it for only the one page where needed.

I can capture the onresize event and display the window dimensions but haven't figured-out how to do it with a Content page that still uses the Master page.  I think I'm having a very "thick" week...

- Tinker


Removing the HTML wrapped around web parts?

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

Getting Html.TextBoxFor Value on client via Javascript

I want to get the value of a inputText createdBy Html.TextBoxFor via Javascript. But no matter how much I type in it, the input does not get a value and thus the javascript generates an error. Can I do this, if so how?

Asp.net MVC: How to call javascript function in Html.ActionLink

When I edit single recored in page, I use checkbox to get a selected row not every row with an actionlink element, but it seemed I cant make this way happen through calling javascript code(function GetSelectedRow() should return an id). Could anyone have a nice idea?<head runat="server"> <title>Index</title> <script type="text/javascript" language="javascript"> function GetSelectedRow() { var a = 0; var chkBoxes = document.getElementsByName("chkSelect"); var count = chkBoxes.length; for (var i = 0; i < count; i++) { if (chkBoxes[i].checked == true) a = chkBoxes[i].primaryKeyID; } return a; } </script> </head> <body> <div> <span style="width:20%"> <%: Html.ActionLink("Add", "Create")%> </span> <span> <%: Html.ActionLink("Edit", "Edit", new { id = GetSelectedRow()) %> </span> <span> <%: Html.ActionLink("Detial", "Details", new { id = GetSelectedRow() })%> </span> <span> <%: Html.ActionLink("Delete", "Delete", new { i

why the ValidateRequest dose not work when html tags had sent by __doPostBack method in javascript

hi friends.why the ValidateRequest dose not work when  html tags had sent by __doPostBack method in javascript.var encodedAllScripts="<html><td></td></html>"; __doPostBack('getHtmlData', encodedAllScripts);

why the ValidateRequest dose not work when html tags had sent by __doPostBack method in javascript

hi friends.why the ValidateRequest dose not work when  html tags had sent by __doPostBack method in javascript.<script>var encodedAllScripts="<html><td></td></html>"; __doPostBack('getHtmlData', encodedAllScripts);</script>

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 apply a css class on html span tag in javascript?



I'm trying to apply a css class on an html span tag in javascript, like below-

$('#company-info').css("class", "help");

But this line of code isn't working!

Can anyone let me know the right way of doing this?



Javascript function call in HTML+VB?


Hi, i try to call a VB.NET function in my HTML body tag

<body onunload = "if (screenTop > 9999) call Session_End;">


Where Session is my Public VB.Net function in the Global.asax but nothing happen. Do I have to write something like "<script type=\"text/javascript\">?.


How to remove white spaces - asp.net 4.0


hello everybody. i want to remove all white spaces at both html and javascript files. how can i achive this.


using iis 7.5

asp.net 4.0

asp.net web site project


thank you 

Removing unwanted spaces in columns

How to remove unwanted spaces empty lines in table columns

remove white space between the html tag


hi i m using vs2005 for development

i haev desing a one web page with size ( 15 k)

now i want to remove the white space and make it in one single line .

how i can do that , thax

html/javascript (jQuery)/ajax patterns question


My presentation layer (UI) will consist of pure html (no webforms) javascript, jquery making calls to (Ajax enabled) WCF services. can I use MVC (in my presentation layer) in this context or not?


html to asp.net page via javascript?


Hi there,

was trying to (unsuccessfully) find this, was hoping someone heard of such thing. I'm have an html as a home page which loads very fast, and so I prefer to leave it instead of getting an .aspx page for a home page. What I want to do is to have a search box on this html page... my question is, is there anyway I can pass information from an html page (via javascript?) to an asp.net page (which would be connected to an sql database)? I was thinking of search strings? has anyone seen a script for sending out a search string like that? My javascript is a bit rusty - would be much appreciated!

any other ideas other than search strings?



Removing White Background From Flash Web Part....


Hi Guys,



if you view the front page you can notice a flash webpart in the top right header of the page.

now if you look realy closely you can see its white background is sitting over the gradient of the head background...

now normally in html you can remove the white background from the embedded .swf file !


how would i go about doing this on sharepoint i looked under the edit webpart section but couldnt find a option to do so....

any feedback would be apreciated..





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