Skip to main content

Posts

Showing posts from January, 2016

What is WebResource.axd?

WebResource.axd provides access to embedded resources within a project. It's a handler that enables control and page developers to download resources that are embedded in an assembly to the end user. You include WebResources in your AssemblyInfo:   [ assembly : System . Web . UI . WebResource ( "Project.Styles.Main.css" , "text/css" )] Then you can get an include path for your Page using the following code:   string includeLocation = Page . ClientScript . GetWebResourceUrl ( this . GetType (), "Project.Styles.Main.css" ); Then to add the above file (which is a CSS file in this case):   LiteralControl include = new LiteralControl ( String . Format ( includeTemplate , includeLocation )); (( System . Web . UI . HtmlControls . HtmlHead ) Page . Header ). Controls . Add ( include ); Then you'll end up seeing references within your page source such as the following:   / WebResource . axd ? d = PhPk80h_UWEcbheb -

Visual Studio Debug VS Release mode

When we want to deploy our web application to live/local server, then we have two options for making built – Release mode and Debug mode. Both the modes have own importance and characteristics. The details about Release mode and Debug mode are as: Debug Mode Developer use debug mode for debugging the web application on live/local server. Debug mode allow developers to break the execution of program using interrupt 3 and step through the code. Debug mode has below features: Less optimized code Some additional instructions are added to enable the developer to set a breakpoint on every source code line. More memory is used by the source code at runtime. Scripts & images downloaded by webresource.axd are not cached. It has big size, and runs slower. Release Mode Developer use release mode for final deployment of source code on live server. Release mode dlls contain optimized code and it is for customers. Release mode has below features: More optimized code Some