Stuck with ye olde ASP.NET Webforms? It doesn’t mean you have to miss out on all the good javascript fun (which is, in fact, also an old technology). At my current client (being a consultant and all), we have carefully introduced Knockout.js for the more complex screens. To be honest, it’s only used in two screens at the moment, but the team is open to it being used more and more. That being said, we don’t regard it as the

ASP.NET (WebForms) has a concept of postbacks. This is not entirely the same a submitting the current form. A LinkButton for example, when clicked, will call a __doPostBack javascript function which was added by ASP.NET. This means that you can’t always subscribe to the ‘submit’ event with jQuery: $(‘form’).on(‘submit’, function() {}); You might want to subscribe to the postback because, just before calling the server, you need to fill some hidden field. At least, that was my case. So, what

In ASP.NET, you can create a textarea by adding a multiline textbox to your markup: <asp:textbox id=”textboxDescription” runat=”server” textmode=”MultiLine” /> Intuitively, we started adding the MaxLength property to this, in order to let the content of the textarea match the length of our database column: <asp:textbox id=”textboxDescription” runat=”server” textmode=”MultiLine” maxlength=”2000″ /> If you’re reading this, you know that doesn’t work. We, however didn’t. This is easily fixed with some javascript. But if you have a large site with many of

I was looking for a way to export a gridview of an asp.net site to an Excel-file (.xls). Most methods I found involved overriding a Page-method and/or disabling validation of the controls. The solution provided by Matt Berseth is safer and more elegant in that it uses a seperate class with a shared method (static for C# people). This way, you can access it from multiple pages without having to rewrite the code multiple times.