By Fernando Mendoza.
I’ve been using Fiddler a lot these days. To test how requests and responses go to and come back from the server, being HTML responses, SOAP responses or custom responses from web services.
One website I like a lot is StackOverflow; I use it to find answers when I’m stuck with a programming or configuration issue. I like this site, and even though they don’t have too many ads it still bothers me a bit. So one day I was thinking if it was possible to use Fiddler to modify the HTTP response from the StackOverflow server before it’s rendered by the browser.
Turns out it’s possible, Fiddler has something called Rules that allows you do that. Let’s see how to do that st...
By Osvaldo Orozco
This is the basic code that you can find when someone converts from an IEnumerable to a CSV string. This will be our starting point.
StringBuilder strBuild = new StringBuilder(1024);
foreach (var item in myList)
{
strBuild.AppendFormat("{0},", item.Key);
}
if (strBuild.Length > 0)
strBuild = strBuild.Remove(result.Length - 1, 1);
string result = strBuild.ToString();
Now, we are going to use the “Aggregate” LINQ function to create the CSV string.
First we need to add the namespace.
using System.Linq;
The Aggregate function has several overloaded methods.
The first method:
TSource Aggregate<TSo...
By Guillermo Cedillo
Create new Project
The master page contains concepts from boilerplate. Boilerplate is an excellent template which groups the best recommendations for webpage performance (it helps you a lot to obtain an A-grade with Yslow or Google PageSpeed).
For our project I just add some features from boilerplate. I like to keep it simple but feel free to review it and implement the best concepts for your project.
Those basic concepts are:
• Add styles on the top and scripts on the bottom.
• Add ie6/ie7/ie8... class in the html tag to allow ie fixes for css.
• Add metatags for compatibility and descriptions.
• Add modernizr for a...
By David E.
Fiddler is a Web Debugging proxy to capture traffic between our computer and the Internet. It shows in detail all the requests made by any application that accesses the Internet. Sometimes it is useful to review a page using Fiddler if there’s an image that we need or we want to know the logic of some specific client functionality, as Fiddler can tell us all files that are loaded when a page loads: html, aspx, css, js, etc.
One of the biggest advantages of a Web Debugging Proxy is that it is possible to see some requests to some services in our applications. Even though we have a desktop application, if there is a reference to a service in our code and we put a call to a m...
By Alejandro Villarreal
I recently did a deployment for which several sites and components needed to be deployed to the same machine, and we didn’t want to provide access through FTP to the whole disk, but to the specific folders where the components had to be deployed. At a first glance this sounded pretty easy: we created the required sites in IIS (each with a different hostname in its HTTP binding), added bindings for FTP in each site, configured a different host name for each of those bindings (for each site, the same hostname that the HTTP binding had), set up security for FTP, and started the FTP service and sites. I must also say that we had another site with an FTP binding that...
By David E.
On rare occasions inside our web application it is necessary to allow the user to enter some content in html format. In previous versions this was possible, and it was the responsibility of the programmer to validate those labels to prevent a user from entering malicious code to our application.
With ASP.net 4.0 the information will now be validated automatically. If a user tries to add html tags to a web application, the result will be an exception. This validation feature can be disabled with a simple statement of the web.config file.
The first thing to do in Visual Studio 2010 is to create a new web application, then we can add a new web form and then create the basic ...
By Alejandro Villarreal
If you’ve ever dealt with the front-end part of application development in ASP.NET, you might have encountered the following error at some point:
A potentially dangerous Request.QueryString value was detected from the client
This happens when the user submits a value (either in a form or in the query string) that the ASP.NET Framework considers dangerous, in the sense that it might be an HTML/script injection attack.
Sometimes it is necessary to turn that feature off (see here and here on how to do it). It might be the case that you expect the user to provide valid XML/HTML, and thus you don’t want the Framework to abort the request with an Exception. As explai...
By Alejandro Villarreal
Distributed transactions can be of great help when dealing with complex operations that must be atomic across servers, but then again for their very nature –distributed– they can be hard to debug when something fails. A good example of this is an error I encountered recently. Here’s a bit of background:
We have a Web Application hosted in Server01 sending messages to a WCF Service through an MSMQ endpoint (we’re using transactional queues to leverage their reliability), and this Service saves the content of the messages it receives in a SQL Server database hosted in a remote server (Server02). The queue in Server01 plus the database in Server02 make this a distri...
By Guillermo Cedillo
Use Microsoft Ajax to extend you services
If you want your service works as a REST service and return JSON is not necessary to do some complex modifications in the web.config or import special libraries. When you have a WCF or an asmx web service already implemented, the easiest and cleaner way to extend your services is using the ScriptManager Control of Microsoft Ajax.
First, enable your service to work with the Script Manager add or uncomment [ScriptService] in every web service that you want to extend.
Then in your page add the Script Manager and add the reference to your services like this:
<asp:ScriptManagerID="ScriptManager1"runat="s...
By Cesar Olivas
Transforms, Animations and Transitions are new modules of CSS3. These 3 modules of CSS are still as a working draft and we can only do as much as it only works in webkit engine but they allow us to see the potential of these properties. This post will explain briefly what can be done using these, as they are something different, that allow us to add eye candy to our pages without fancy JavaScript. Notes:The red border on the divs are just to point to the top of the boxThese Examples will only work on Safari and Google chrome. A live example can be seen at http://www.sieena.com/Pages/transforms_animations_transitions.htmlAdded to the CSS that I will mention, all of these...
Next >>