Archive for category ASP.NET
The sometimes overlooked Enumerable.Range
Posted by Johan Leino in ASP.NET, C# on April 27, 2011
I’ll start with confessing that the first time I saw LINQ and especially Enumerable.Range I didn’t see what I would use it for. Well, luckily times change… An example The other day when I was writing some code for a mockup and I hade to generate some fake data. More than often, that sort of […]
Revised:Cascadingdropdown causes invalid postback or callback argument error
Posted by Johan Leino in ASP.NET on April 9, 2011
A while back I wrote a post about how to solve the error message you can get from using the Cascading Dropdown Extender from the Ajax Control Toolkit which is: “Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation=”true”/> in configuration or <%@ Page EnableEventValidation=”true” %> in a page. For security purposes, […]
Building a little menu with a some JSON, LINQ and the JQuery Template Plugin
Posted by Johan Leino in ASP.NET on March 1, 2011
This is a little tutorial I thought I´d write about a little problem I recently solved with a couple of different technologies that worked very well together. Background From a customer I got a request to build some sort of navigation (or menu) for some items, let´s for the sake of this little tutorial pretend […]
Using jQuery to trigger click event on linkbutton
Posted by Johan Leino in ASP.NET on May 5, 2010
I ran into a little problem with jQuery today which I thought I´d share with you. I had an asp.net list view with an item template and an edit template. Source code can be downloaded from my github repo. What I wanted to accomplish was to be able to use either the edit button or […]
Using a generic ascx control to display messages to the user
Posted by Johan Leino in ASP.NET, SharePoint on January 26, 2010
I have many times been involved in projects where the customer wants the application (web/SharePoint) to inform the user when something is successfully completed or for that matter when the app fails. Since I usually implement things using ascx controls (usercontrols) this has in most cases been implemented using a method on the masterpage/page that […]
Adding assemblies and namespaces to web.config to avoid duplication of code
Posted by Johan Leino in ASP.NET, SharePoint on November 5, 2009
In many (like all of them) items in SharePoint (aspx/ascx/master) I work with you keep repeating the same sort of code in the page directive. Adding the ability to work with controls from the Microsoft.SharePoint.WebControls and Microsoft.SharePoint.Publishing.WebControls namespaces. This code is “duplicated” in all these items and I don´t like repeating myself so wouldn´t it […]
Lazy loading ascx UserControl (or something else) at loadtime
Posted by Johan Leino in ASP.NET, SharePoint on June 15, 2009
I wanted to make an ascx usercontrol “lazy” load when it´s loading on aspx page. So I´m really using the ascx as a view (if you know about MVC you´ll get that) that only acts when it receives data. So the thing I was after was something like… The user makes a choice of a customer from […]
How to force Visual Studio to generate (or regenerate) your .designer file
Posted by Johan Leino in ASP.NET, SharePoint, Visual Studio on March 12, 2009
I got stuck on a problem (related to the title of this post) today and thought I´d share my experiences (and how I solved it). I had a class library project that I wanted to change into a web application project and copy some stuff from an old web application project that I had. That […]