How Things Work – ASP.NET 2.0 – CodeBehind

Series Theme This how-to series is my personal exploration into figuring out not just how to make things work, but how they actually work. The theme behind this series is: "If it's not broken, take it apart and try and figure out why". I plan on covering many issues in ASP.NET 2.0. If you are interested in a particular part of ASP.NET 2.0 that I have not covered, please contact me and time permitting, I'll see if I can figure out how it works. Abstract In this article, a simple asp.net 2.0 page will be taken apart and shown how the actual page class is put together. As we know, when an http request comes into asp.net through the http pipeline that is destined to be a page (file type aspx), the objective of asp.net 2.0 is to … Continue Reading

Inserting Programmatically with ObjectDataSource in ASP.NET 2.0

( ObjectDataSource1.Insert(); ) ObjectDataSource's are great for building your own middle tier between your aspx web page and your database (or any other datastore for that matter). By binding the datasource to a databound server control like detailsview, you auto-magically get the insert behavior you are looking for. If however, you just just want to insert to the ObjectDataSource you have included on your aspx page without using a databound control, you don't have a lot of fancy footwork to do. All you have to do is reference the insert parameter by name (or index offset) and assign it directly. … Continue Reading

How To Set a Date Format In GridView Using ASP.NET 2.0(Using HtmlEncode Property)

(AKA, the DataFormatString="{0:M-dd-yyyy}" Problem)   A very common desire is to set a column of a GridView to display just the month, day and year of a DateTime type. The problem is the by default, the HtmlEncode property of the BoundField attribute ( <asp:BoundField ...) is set to True. The reason for this (as pointed out in the documentation of this attribute) is that this helps prevent cross-site scripting attacks and malicious content from being displayed. Microsoft recommends that the HtmlEncode attribute be enabled whenever possible. If you have a problem like this involving ASP.NET WebForms or MVC, consulting services are available. This is quite an old post, but still relevant even as we head into 2012 with the … Continue Reading

Membership Editor Works With Atlas March CTP

Membership Editor Works With Atlas March Community Technology Preview IE and Firefox! In two previous postings I used the January version of Atlas. At MIX06, Microsoft released the next version which is known as the March CTP. I have updated my web demonstration programs to take advantage of the new Atlas. The basic difference now is that the demonstrations all now work with Firefox as well as IE. I don't know about other browser compatability issues, but I'd sure like to hear if they work in your browser. The code can be run at the following locations: http://livedemos.peterkellner.net/ (using March Atlas) http://livedemos.peterkellner.net/DefaultNoAjax.aspx (no Atlas, just for comparison) and demonstrating adding Membership with … Continue Reading

Follow

Get every new post delivered to your Inbox

Join other followers: