I’ve added new constructs for replacing < % Html.RenderPartial("~/Shared/LogOnUserControl.ascx", model); %> with these < % Html.RenderPartial().Shared.LogOnUserControl(model); %> where model argument is strong typed of course. There […]
Strong typing routes in ASP.NET MVC
Let’s say you have Test action in Home controller like this: public ActionResult Test(int id, int tubo) { return View("Index"); } And you want to create a hyperlink […]
Strong typing views in ASP.NET MVC
Did you ever wonder why do you have to write code like: public ActionResult SomeAction() { … return View("SomeView", model); } instead of this beauty: public ActionResult […]
Slicker call to Dispose method
Do you ever get tired of code like this: if (someObject != null) { someObject.Dispose(); } or its shorter version if (someObject != null) someObject.Dispose(); Isn’t annoying to […]
Partial Output Caching in ASP.NET MVC updated
Thanks to Miha Valenčič I’ve found this great article about Partial Output Caching in ASP.NET MVC. It actually explains how to do ActionResult caching in ASP.NET MVC. It […]
My first ASP.NET MVC pet project – Walls Talking
This week I’ve been extremely busy. Besides my usual work that pays for my living I worked on my first ASP.NET MVC project: Walls talking. I followed ASP.NET […]
Entity Framework leaves the door open to a SQL Injection attack?
I couldn’t believe it when I read Julie Lerman’s post about EF and SQL Injection. She discovered that Entity Framework doesn’t use parameterized queries always! I had to […]
Calling WCF services from within Sql Server
It is possible to create a managed .net stored procedure for SQL Server that acts like a WCF client. SQL Server 2005 at least is required. But I […]
Using extension methods to make code less cluttered
Here is an example where an extension method is useful. Take this [LGP] code for example: public EntityCollection<CustomersEntity> GetCustomers() { using (DataAccessAdapter da = new DataAccessAdapter("Data Source=[SERVER];Initial Catalog=Northwind;Integrated […]
Visual Studio, CodeRush and Silverlight 2
If your Visual Studio 2005 or 2008 freezes while creating a Silverlight project, or any other project then you might try switching off [CodeRush] add in. Yep, it […]