Tag: ASP.NET
All the articles with the tag "ASP.NET".
-
ASP.NET MVC - Testing issues Q and A
When playing around with the ASP.NET MVC framework and automated tests using Rhino Mocks, you will probably find yourself close to throwing your computer trough the nearest window. Here are some common issues and answers: A: When testing a controller action which expects Request.Form to be a NameValueCollection, a NullReferenceException is thrown... This is due to the fact that Request.Form is null. Use Scott's helper classes for Rhino Mocks and add the following extension method: [code:c#] public static void SetupFormParameters(this HttpRequestBase request) { SetupResult.For(request.Form).Return(new NameValueCollection()); } [/code]
-
March 18 ASP.NET MVC links
Too busy this week to write large blog posts myself... Luckily other people do write interesting things on ASP.NET MVC! Happy coding!
-
Heroes happen here - Microsoft TechDays 2008 in Belgium
Just to inform you: together with a numer of colleagues from Dolmen, I'll be attending the Microsoft TechDays 2008 in Ghent, Belgium on 12 and 13 March 2008. Want to spot me, Joris, Jeroen, Danny, ... and meet in person? Search for one of the guys in a Dolmen shirt! Update 17/03/2008: Jeroen posted an overview of the inspiring sessions on his blog.
-
Data Driven Testing in Visual Studio 2008 - Part 2
This is the second post in my series on Data Driven Testing in Visual Studio 2008. The first post focusses on Data Driven Testing in regular Unit Tests. This part will focus on the same in web testing. I assume you have read my previous post and saw the cool user interface I created. Let's first add some code to that, focussing on the TextBox_TextChanged event handler that is linked to TextBox1 and TextBox2. [code:c#] public partial class _Default : System.Web.UI.Page { // ... other code ...
-
Data Driven Testing in Visual Studio 2008 - Part 1
Last week, I blogged about code performance analysis in visual studio 2008. since that topic provoked lots of comments (thank you Bart for associating "hotpaths" with "hotpants"), thought about doing another post on code quality in .NET. This post will be the first of two on Data Driven Testing. This part will focus on Data Driven Testing in regular Unit Tests. The second part will focus on the same in web testing. We all know unit testing. These small tests are always based on some values, which are passed throug a routine you want to test and then validated with a known result. But what if you want to run that same test for a couple of times, wih different data and different expected values each time?
-
Books I recently read...
A while ago, I was contacted by the people of Packt Publishing asking me to review two of their latest books, ASP.NET Data Presentation Controls Essentials (by Joydip Kanjilal) and LINQ Quickly (by N. Satheesh Kumar). Since both books stated something about LINQ on the back-cover, and me wanting to read more on that matter, I engaged into reviewing them. Being an ASP.NET developer, I'm not new to ASP.NET's data bound controls. Upon receiving the book, I immediately knew this was not going to be new stuff to me, a thought which proved right. Nevertheless, the book has a value!
-
ASP.NET Session State Partitioning using State Server Load Balancing
It seems like amount of posts on ASP.NET's Session State keeps growing. Here's the list: Yesterday's post on Session State Partitioning used a round-robin method for partitioning session state over different state server machines. The solution I presented actually works, but can still lead to performance bottlenecks. Let's say you have a web farm running multiple applications, all using the same pool of state server machines. When having multiple sessions in each application, the situation where one state server handles much more sessions than another state server could occur. For that reason, ASP.NET supports real load balancing of all session state servers.
-
ASP.NET Session State Partitioning
After my previous blog post on ASP.NET Session State, someone asked me if I knew anything about ASP.NET Session State Partitioning. Since this is a little known feature of ASP.NET, here's a little background and a short how-to.
-
Preview Word files (docx) in HTML using ASP.NET, OpenXML and LINQ to XML
Since an image (or even an example) tells more than any text will ever do, here's what I've created in the past few evening hours: Live examples: Want the source code? Download it here: WordVisualizer.zip (357.01 kb) If you want to know how I did this, let me first tell you why I created this. After searching Google for something similar, I found a Sharepoint blogger who did the same using a Sharepoint XSL transformation document called DocX2Html.xsl. Great, but this document can not be distributed without a Sharepoint license. The only option for me was to do something similar myself.
-
ASP.NET MVC framework - Security
Some posts ago, I started playing with the ASP.NET MVC framework. In an example I'm creating, I'm trying to add Forms-based security. "Classic" ASP.NET offers a nice and easy way to set security on different pages in a web application, trough Web.config. In the example I'm building, I wanted to allow access to "/Entry/Delete/" only to users with the role "Administrator". So I gave the following snip a try: [code:c#] <location path="/Entry/Delete"> <system.web> <authorization> <allow roles="Administrators"/> <deny users="*"/> </authorization> </system.web> </location> [/code]