Tag: CSharp
All the articles with the tag "CSharp".
-
OpenXML + Silverlight 2.0 = cool!
Mix '08 announced some nice things, among them the release of Silverlight 2.0 (beta), ASP.NET MVC framework (CTP 2). This morning, I saw one very cool thing in my RSS reader: TextGlow. TextGlow is James Newton-King's newest exciting project which basically combines Silverlight 2.0 and OpenXML into a fancy web-based Word 2007 document viewer. Think about combining this with my own Word 2007 document preview handler...
-
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?
-
Code performance analysis in Visual Studio 2008
Visual Studio developer, did you know you have a great performance analysis (profiling) tool at your fingertips? In Visual Studio 2008 this profiling tool has been placed in a separate menu item to increase visibility and usage. Allow me to show what this tool can do for you in this walktrough. Before we can get started, we need a (simple) application with a “smell”. Create a new Windows application, drag a TextBox on the surface, and add the following code: [code:c#] private void Form1_Load(object sender, EventArgs e) { string s = ""; for (int i = 0; i < 1500; i++) { s = s + " test"; } textBox1.Text = s; } [/code]
-
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]
-
ASP.NET DataPager not paging after first PostBack?
A few posts ago, I mentioned that I am currently giving a classroom training on ASP.NET. People attending are currently working on a project I gave them, and today one of them came up to me with a strange problem... Here's the situation: in VS 2008, a web page was created containing 2 controls: a DataList and a DataPager. This DataPager serves as the paging control for the DataList. Databinding is done in the codebehind: [code:c#] protected void Page_Load(object sender, EventArgs e) { ListView1.DataSource = NorthwindDataSource; ListView1.DataBind(); } [/code]