-
|
There is a sample chapter from my upcoming book on all things performance related within the Microsoft platform. Specifically, the book will be about performance testing, profiling and optimisation for web and desktop applications developed using Microsoft.NET. This sample chapter is just a teaser and the book itself goes into great detail about how to setup a performance test rig using Visual Studio, how to record, manage and analyse performance metrics, and what you can change to make your apps fly. Anyways, the sample chapter is located here . ( http://www.simple-talk.com/dotnet/performance/understanding-performance-profiling-targets/ ) Hope you like it. Read More...
|
-
|
You can use the ASP.NET Membership provider to generate a new random strong password. In the past I have usually either rolled my own authentication system or integrated an asp.net authentication system into an existing application and therefore I did not use the ASP.NET Membership system. In the current application I am writing, I had a need to generate a random strong password for the customer. The ASP.NET Membership system already has a static method built-in for this. You can use the GeneratePassword static method from the Membership class to create a new password: String strongPassword = System.Web.Security.Membership.GeneratePassword(8, 1); From the MSDN documentation, the two parameters are: length – Int32 The number...
|
-
|
Linq is used generally to get and manipulate data by using Linq to Sql, Linq to Entities or Linq to Xml. However, it can work on many collections in .NET Framework. Now in this post, I'll show how to work on Page Control Collection with Linq. Think about the scenario you want to get every textboxes that has a text in it. To see which ones we select add them a text you want. Create a new .aspx page and add several textboxes to it. They can be directly in page or another control (i.e. a panel control). Then add the code below to [Further] Read More...
|
-
|
I’m working with my Fluent-API for adding Action Filters to Controllers and Action Methods. In my previous post , I created a new instance of each Action Filter and add it to an Action Method or Controller. Based on how the Action Filters are often implemented they don’t or shouldn’t keep any state, so in that case I don’t need to create a new instance of the same Action Filter with the same configuration for each Action Method I want to add it to. I also want to have an option to have a better overview of which Action Filter is added to which Controllers and Action Methods. I have added to methods, AddFilterToControllers and AddFilterToActions: .AddFilterToActions( new HandleErrorAttribute(), c=> c.About(), c=> c.Index()); .AddFilterToActions...
|
-
|
Note: The name of the classes and the methods are just temporary and may change, I’m so bad when it comes to naming classes and methods. The source code is simple and haven’t done so much refactoring etc. Just wanted to see if I could get it to work, so please have that in mind. When we create controllers for our ASP.NET MVC application we can also add Action Filters to handle cross-cutting concerns, like Authorization, Error handling and Caching etc. If we want to have Error handling on every controller we need to add the HandleErrorAttribute to all controllers, like this: [HandleError] public MyController : Controller { } By adding Action Filters by using attributes it can be hard to get a good overview of which controllers that has the HandleErrorAttribute...
|
-
|
This week I attended and spoke at the Oredev conference in Malmö Sweden, and it was great fun as usual. It was a pretty productive few days with a lot of good talks and conversations with some really cool people. I’ll put up a link to the talk as it becomes Read More......( read more ) Read More...
|
-
|
I get this question all of the time, and there is a great support article from Microsoft on how to do this. One of the ways to truncate the log file is to simply detach the database and re-attach it without the log. I DO NOT recommend that unless it is a development db that you don’t care about. The proper way to do this is to first backup the TRANSACTION LOG portion of the database by using the following command: BACKUP LOG <DatabaseName> TO DISK = '<BackupFile>' And then running a shrinkfile command: DBCC SHRINKFILE (<FileName>, <TargetSize>) WITH NO_INFOMSGS If you run the shrinkfile command without first doing a log backup, all it will remove is the empty space in the ldf file, no matter what target...
|
-
|
I am proud to inform you that yesterday we released our Q3 2009 version of Telerik Extensions for ASP.NET MVC. As promised this release includes: Grid Menu PanelBar TabStrip You can find the live version and source codes in the following locations: Live Version Source Code Also checkout the product home page and part-II of Tod’s unofficial faq . In this post, I will show you how to create a basic CRUD(Create/Read/Update/Delete) application with our new MVC Grid. I will be using both Entity Framework v1.0 with the default web form view engine and NHibernate with Spark to create the CRUD screens for the Customer table of Northwind database. Lets start with the Entity Framework and Default View Engine. First, lets create a new ASP.NET MVC application...
|
-
|
I saw a bug on Connect today in which someone offers the suggestion that the PageRouteHandler (new in ASP.NET 4) should handle IHttpHandler as well as Page . I don’t really agree with the suggestion because while a Page is an IHttpHandler , an IHttpHandler Read More......( read more ) Read More...
|
-
|
While working on Versatile DataSources , I wanted to provide a new design mode feature on properties where you specify the name of a class type. For example, EntityDAODataSource has EntityTypeName and DataContextTypeName. Adding a dropdownlist to a property in the Visual Studio Properties Editor is easy: Create a TypeConverter class, return true in the GetStandardValuesSupported() method, and implement the GetStandardValues() function to return a list of strings. The trick is to return a list of known types, and only those added by the user (as opposed to those in the GAC and third party assemblies). That’s where the System.ComponentModel.Design.ITypeDiscoveryService interface applies. It lets you retrieve a complete list of all available types...
|