So, this is kind of embarrassing, that it took me a while to figure this out. I have not been doing pure asp.net server control programming for a while, but I figure since it took me a while, maybe there is someone else in the same boat.
So, you have a GridView or DetailsView that has standard “Edit” “Update” “New” type command buttons on them. The way they get there is by having the declaration something like this:
(more…)
Many of you know of ORCSWeb either by reputation, or by way of Scott Forsyth, one of my ASP.NET MVP brothers. In case you don’t, they are a managed hosting solutions company specializing in Microsoft technologies. I’ve used their basic services for quite a while and have always been very happy. It has always seemed that anytime I’ve called them (and it always seems like the middle of the night) one of their tech support staff is always available to help me, and go the extra mile if necessary.
The company I’m now working at is small and we don’t have a lot of resources to maintain hardware and do operating system type support. We do have a high load requirement so we need a very robust supported solution. Before this, I’d always been in the under $50 per month type plan with ORCSWeb, but I decided I needed more servers and a higher level of support. I really did not know what level of support to expect when signing up for the managed servers but decided to go for it anyway.
All can say is WOW!!! I am over the top impressed.
(more…)
At tonight’s meet up, we will be having several short presentations on the new features in ExtJS version 3.0. For my short presentation, I will be showing how to build a simple asp.net application that lets you Create, Update, Delete and Edit Membership data using the ASP.NET built in membership providers. I will be leverage code from an MSDN article I wrote a while back here along with the URL to the meetup location.
http://www.meetup.com/The-San-Francisco-ExtJS-Meetup-Group/calendar/10302891/
http://msdn.microsoft.com/en-us/library/aa478947.aspx
My plan is to do a progression where I start with a trivial GridPanel, then work myself in 5 steps to a full working membership editor that looks like this:
(more…)
Seems, I keep forgetting where the temporary files asp.net uses. The reason it’s nice to know is sometimes you may want to open them with Reflector to see the generated code. Also, sometimes, you want to delete those files because asp.net is confused and is reusing old ones. So, here is the magic lines of code you need.
(more…)
In my previous post, Assigning a DropDownList Value in a ASP.NET GridView Using ObjectDataSource, I discussed how to put a DropDownList value in a GridView. As I explained, my motivation was to answer a common question that appears on often on the forums. If you are wondering what my process is for deciding what to answer, there really is no process besides I see yet another question on the forum about this, and rather than answer it again, I write a post explaining it, then point my answer to the question at the post. This is what I did yesterday and below is the response to this forum post.

(more…)
Article Series
The Problem
For the third year in a row, Silicon Valley’s Code Camp is happening. The way I’ve organized the data is that each year I make a fresh new sql server 2005 database catalog. this means that I have one for 2006, one for 2007 and a new one for 2008. I want to do a mailing to all people who have registered to previous code camps and who have not registered yet for this code camp. This way, I can do multiple mailings without worrying about sending to people that who have registered (which would make me look silly for not knowing they registered already). I do not like when people say things like "Ignore this message if you have registered…". In addition we will maintain an opt out list so that people who do not want additional emails sent can request that and not worry about us sending more emails.
(more…)
Article Series
Introduction
Creating themes for ASP.NET 2.0 is very easy if you follow the standard guidelines Microsoft gives us. Microsoft gives a pretty good discussion in the MSDN article
ASP.NET Themes and Skins Overview. I’ve read it several times but since I don’t do this very often I keep forgetting the simple things. Recently,
I posted a question on ASP.NET forums asking how to have an image automatically come from the correct theme directory. As usual, Dave Sussman
gave me the perfect answer.
"You should store the images under the themes and set the ImageUrl in the skin file. Give the control a SkinID in both the skin file and in the page. When the theme changes the appropriate image will be used."
In this article, I’ll basically explain his answer with an example using the code camp web site.
(more…)
(That’s right, Code Camp is coming! 11/8 and 11/9 again at Foothill College)
Article Series
So, first, a little background. As many of you know, I’ve been the ring leader of Silicon Valley Code Camp here in northern California for the past 2 years. Since Code Camp is a limited budget, 100% volunteer effort, the most important thing is to have efficient communications between everyone. Attendees, Speakers, Organizer, Sponsors and everyone else involved in the event. To that end, the first code camp web site was created. It was based on CSS provided by Microsoft. Check out the post I made two years ago about it titled "Zero to Professional Web Site in Two Days".
(more…)
So, this may seem simple, but for an hour I wrestled with displaying images on IIS7 with vista. ASP.NET worked fine, but no static files, css, jpg’s, gif’s or anything. Just unformatted text.
Turns out when I added the web server in vista, I forgot to check the Static Content checkbox under World Wide Web Services / Common Http Features.
(more…)
So, I guess I should have know the answer to why the following does not work. Basically, the scenario I have is that I have a foreign key column in my GridView that I want to show as a DropDownList of values. The code below shows me the values in the DropDownList, but when I update it with the “edit” of the GridView row, the value does not get saved. Here is the code and what it looks like running:
(more…)
I’m basically a back end database kind of guy, but over the past years have been doing more front end web stuff. Asp.Net has been a huge help for me, and now with Visual Studio 2008 and the JavaScript debugging capabilities, I’m finding doing web stuff is just not so bad. Many of you know I’ve written several MSDN articles and one of them was over a year ago on how to add Ajax to my Membership solution (back then it was called Atlas). The article is still out there though now a little out dated. In it, I extensively use Alessandro’s code he posted on his blog. My point here is Alessandro keeps up with this stuff, and as it turns out, he wrote an excellent book that’s been helping me out.
I enthusiastically recommend it to anyone trying to incorporate Ajax into their asp.net applications. It’s not only got a great introduction, but also goes into lots of useful details for day to day programming.
So, I’ve been struggling for a while with how to style a checkbox to work with a skin file. Basically, what I did was create some gif files that look like checked and unchecked check boxes. I defined them in my SkinFile.skin file as follows:
<asp:ImageButton SkinID="iconCheckedDisabled" ImageUrl="Images/iconCheckedDisabled.gif" runat="server" ToolTip="Checked Disabled" />
<asp:ImageButton SkinID="iconCheckedEnabled" ImageUrl="Images/iconCheckedEnabled.gif" runat="server" ToolTip="Checked Enabled" />
<asp:ImageButton SkinID="iconUnCheckedDisabled" ImageUrl="Images/iconUnCheckedDisabled.gif" runat="server" ToolTip="Unchecked Disabled" />
<asp:ImageButton SkinID="iconUnCheckedEnabled" ImageUrl="Images/iconUnCheckedEnabled.gif" runat="server" ToolTip="Unchecked Enabled" />
The image files look like the following:
(more…)
So, I’ve been preaching for a long time that it’s best to use the Using pattern when working with anything that implements IDisposable. That way, you don’t have to worry about calling Dispose, or calling Close. The framework will just do it for you. I’ve answered this question on the forums several times so I thought I’d past some code I’m doing right now for simple ado.net stuff. It’s actually code that is inside a business object that I hook up to an ObjectDataSource in asp.net 2.0.
The code is posted below. I think you’ll get the idea.
(more…)
(Using Membership ObjectDataSource From MSDN Article)
I’m doing a project where I have lots of DropDownList’s on a page and want a simple way to set the initial values based on some known value. The DropDownLists are retrieved using ObjectDataSource but I don’t want the first value displayed. I wrestled some with how to do this using page_load or page_prerender but didn’t come up with good solutions. I did finally
decide that programming the databound event of the dropdownlist was probably the best way to go.
The solution is pasted below. The MembershipUtilities.MembershipODS c# code can be downloaded from MSDN or on my web site at the following location.
(more…)
Topic: Building animation into "Community Media Browser" for Leverage Software with Silverlight Alpha 1.1

(more…)
Recently, is seems that many web sites and blogs are starting to use a navigation technique where you have multiple hyperlinks grouped in a box, with size, color, or brightness giving some meaning. I like this very much and have been on the lookout for a while for a control to do this in ASP.NET. Turns out, DevExpress has one! It’s called the CloudControl and you can read more about it at the following URL.
(more…)
(User MapPath and FileStream Together)
A very common scenario we often run into is we need to log some information to a local text file on the web server. We know we can use all the health monitoring capabilities built in to asp.net for reasons like performance,
standards, best practices, etc., but sometimes, you just want to log something right now and you don’t want to spend a lot of time.
(more…)
From Non-Local Servers Asynchronously
This issue has come up several times for me. That is, you have an image url you want to display in your silverlight .net 1.1 application that comes from some foreign server. That is, you want this to work: (and of course
it does not).
The Problem

(more…)
The Visual Basic Version of the Objects!
Back in January of 2006, I published on MSDN an article and source code for managing ASP.NET 2.0 Membership users with an ObjectDataSource. Since I’m not much of a VB person, I only published them in c#. since then, I’ve had hundreds of requests for this code in VB. Until now, I’ve had to send an excuse for not having it. Now, thanks to Dave at Tangible Solutions Software, we now have a VB version. Dave converted it with there conversion software called Instant VB.
The following zip file includes these VB objects along with a very simple aspx page in VB. It does not include any more complete examples of using the objects because the code associated with the aspx pages I wrote is all in c#. If anyone wants to convert the other pages, I’d be happy to post those also.
Thanks Dave and Thanks Tangible Solutions!
http://peterkellner.net/DownLoads/MembershipEditorVB.zip