How to remove unnecessary headers from Asp.NET

Web applications use headers to send and receive important information from the client machine to the server. Here is an example of what some of the headers are: ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 ACCEPT_ENCODING gzip, deflate, sdch, br ACCEPT_LANGUAGE en-US,en;q=0.8 CONNECTION keep-alive HOST www.fahadjameel.com REFERER https://www.google.com/ UPGRADE_INSECURE_REQUESTS 1 USER_AGENT Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57....

April 17, 2017 · 2 min · 367 words · Fahad

.NET Evidence Based Security

To really get a better idea of .NET security we first have to talk a little about the CLR. The CLR plays a major role in security when deploying an application. These are the steps of a deployment: Retrieve the assembly's evidence (assembly's strong name, digital signature, sign code signature, and Internet zone where executed. Referencing the security policy - Determines the actions the code is allowed to perform....

July 18, 2015 · 2 min · 305 words · Fahad

How to add pagination to asp.net

One of the most important feature on a website that has a search feature is that it allows for pagination (allow you to page the results). The reason you would want to make pages is to make your website run faster for the user. Rather than displaying 1000 results on one page you can change it to display 10 results on one each page with a total of 100 pages, which speeds up the site and makes navigation easier....

June 18, 2015 · 2 min · 317 words · Fahad

Adding transformations to your web.config

Transformations in asp.net is an easy way to automatically set your configurations in different environments. An example of this would be when we want our connection strings, usernames, passwords, proxies, etc. to be different in our development environment from our production environment. Since the web.config file is written in xml, we use XML Document-Transform(xdt) to make the transformations. In your VisualStudio project every web.config has a Web.Debug.config and Web.Release.config. If you have never used transformations before, you probably don't know what these files are for....

June 15, 2015 · 1 min · 194 words · Fahad

Unit testing session and application variables without mocking

If you have been unit testing your asp.net web applications that use session and application variables then you almost certainly have encountered this problem and asked yourself \"How to unit test HttpContext.Current variables?\". The general answer you would find online is use a mocking framework (Moq, Rhino Mocks, etc.). While this is the best answer, it assumes that you have written your application using interfaces to pass objects from one place to another....

June 12, 2015 · 2 min · 215 words · Fahad