Gunnar Peipman's ASP.NET blog
ASP.NET, C#, SharePoint, SQL Server and general software development topics.
-
ASP.NET MVC: Converting business objects to select list items
Some of our business classes are used to fill dropdown boxes or select lists. And often you have some base class for all your business classes. In this posting I will show you how to use base business class to write extension method that converts collection of business objects to ASP.NET MVC select list items without writing a lot of code.
-
ASP.NET 4.5 Preview: Using model binding to update data
My last posting about ASP.NET 4.5 introduced how to use strongly typed controls to display data. Using strongly typed presentation layer templates is not the only thing that model binding is good for. From ASP.NET MVC we know how convenient it is when model binders are also able to update our objects when they are modified. In this posting I will show you how to use strongly typed FormView to save data that user modified.
-
ASP.NET 4.5 Preview: Using model binding to display data
ASP.NET Forms 4.5 Preview introduces us model binding for web forms. Web developers who are familiar with ASP.NET MVC already know what model binding is and how powerful it is. Model binding means framework ability to construct objects of known types using values from presentation layer. In this posting I will show you how to use model binding with ASP.NET Forms 4.5.
-
ASP.NET MVC 4: Display modes
One new features of ASP.NET MVC 4 is support for display modes. This means that you can conditionally show different output to different user agents like desktop and mobile browsers. Of course, you can define your own custom rules too. In this posting I will show you how display modes work and explain how to use them in your ASP.NET MVC applications.
-
ASP.NET MVC 4: New mobile web application template
ASP.NET MVC 4 Developer Preview introduces also new template for mobile web applications. These templates are special because they are using jQuery Mobile – special jQuery library for building mobile user interfaces. In this posting I will show you how new mobile web application template looks like.
-
ASP.NET MVC 4: New template for web applications
I’m playing with ASP.NET MVC 4 Developer Preview. There is new default application template available for ASP.NET MVC 4 web applications. New template is modern, has better look than current one and has better support for different screen sizes. In this posting I will show you how new template looks like.
-
Using Lucene.NET search engine library in .NET applications
Adding search capabilities to applications is something that users often ask. Sometimes it is not enough to have just filters on lists. Instead of going with mainstream and write complex SQL queries we can be smarter and use specialized indexing and search solutions that perform way better than custom large SQL queries that I consider as anti-pattern for searching something. In this posting I will introduce you Lucene.NET indexing and search engine and show you how to use it in your applications.
-
Using Moq to mock ASP.NET MVC HttpContextBase
Here’s my little example about how to use Moq to mock HttpContextBase and it’s members to make controller tests pass. You can use this code when you are not allowed to use open-source or use-on-your-own-risk pieces of software that provide you this kind on initialization using built-in features. Also it is good exercise that introduces you how to solve mocking problems.
-
Importing issues from Jira to database using C#
I am evaluating hosted Jira Studio and it likes me more and more when I’m using it. As hosted service is not in our premises and contains important information about our work I was asked to find out if there’s a way how to read data from Jira Studio and save it to our local data store. In this posting I will show you a simple way how to read issues from Jira Studio and save them to database.
-
ASP.NET MVC: Moving code from controller action to service layer
I fixed one controller action in my application that doesn’t seemed good enough for me. It wasn’t big move I did but worth to show to beginners how nice code you can write when using correct layering in your application. As an example I use code from my posting ASP.NET MVC: How to implement invitation codes support.