ASP.Net

Visual Studio had a problem where it would added "a lot of nbsp" when toggling from Design to HTML mode with certain custom controls. I blogged about it originally here. It appeared to be fixed as I described on another post, but it only seemed to occur less often. Finally, there is an official fix. It's not truly a "hotfix" though. It asked me to reboot to complete the update. Tags: Visual Studio, ASP.Net, Server Controls ......
A couple of weeks ago, I was working on some client side UI elements on one of my projects. I was able to apply some things that I have learned recently (some more recently than others). The problem is that I have a domain object that tracks the selected days of the week. Currently the object uses a List<DayOfWeek> to manage the selections. (This is not exactly the most safe thing because a client could set the list to null. However, that's a different subject.) What I was looking for was an ......
I've been using ReSharper now for about one and a half weeks. Now that I am writing some new code, I have more to share. The most helpful and time saving feature that I have encountered so far is code generation. In one case, I had added a couple of new properties to one of my entity objects. In actuality, I add the code in my test first. R# quickly recognized that the property didn't exist and gave me the option to create a field or property. I chose the property option and presto, R# found my class ......
I ran into the same old "cannot serialize value myType of type myType" issue the other day and knew immediately that I should check that my classes were marked with the [Serializable] attribute. Well, I checked and all of the classes had the attribute as required. So I spent an hour our so searching the web for other reasons why we might get this error. I found nothing. So I pinged a buddy of mine and I walked him through the issue. He said, "It's gotta be one of your classes missing the Serializable ......
I've had a few comments to my PageMethods blog from about a month ago. They were all along the lines of "not enough code." I wasn't really intending to provide a detailed account of my experience, but to exclaim how cool PageMethods are (at least for my scenario). Well, I am hoping to put some time aside over the next week or two to write a brief article on the subject. I'll be sure to include all of the code and hope to go through each step of the relatively short process. By the way, if anyone ......
[If you are looking for a quick answer, jump here.] Yesterday morning was probably one of my least favorite in recent memory. I arranged to take the day off to go shopping with my wife, but I had to check-in to make sure everything was okay at the office. I checked my email from home and found that there were suddenly two issues reported on my project that was scheduled for an update in production that night. Needless to say I had to address the problems. It turns out that neither were more than ......
So I was hoping this post would be a glorious review of my first attempt at working with WebParts and Oracle. Alas, the experience has not been so glorious. I am working on a "dashboard" of sorts as a demo for my boss. I spent a few hours on it this afternoon as a spike to see if the approach is feasible. I have to say that I believe it is, but there is one major kink I have to work out. ASP.Net WebParts uses the SqlPersonalizationProvider by default. Unfortunately, we are developing on Oracle. However, ......
Introduction Last time we spent a lot of time on the SelectionController. To conclude the series, we will hook the selection behavior into our CustomGridView. Recap: Custom GridView Guidelines - Preface Custom GridView Guidelines - Part 1 - Preparing the Canvas Custom GridView Guidelines - Part 2 - Selection Interface Custom GridView Guidelines - Part 3 - SelectionController Implementing the IRowSelectionView There are quite a few events on the view that the CustomGridView needs to implement. In ......
Introduction This part in the series will focus on the SelectionController. Here is where most of the work is done. We've already covered the view interface, IRowSelectionView. Now we will see how the controller interacts with the view. Recap: Custom GridView Guidelines - Preface Custom GridView Guidelines - Part 1 - Preparing the Canvas Custom GridView Guidelines - Part 2 - Selection Interface Capturing Shift and Ctrl Key Status We want to emulate multi-selection as in Windows Explorer. The Shift ......
Introduction I briefly described the design approach in Part 1. This part in the series will explore the ways in which the custom GridView communicates to the controller. I extend my apologies for the lack of code. I am limited in what I can provide. I hope that these guidelines will help point you in the right direction. Classes / Interfaces CustomGridView - The GridView we are customizing SelectionController - Responsible for the row selection behavior IRowSelectionView - How CustomGridView and ......
Background Way back in March I posted about a custom GridView I was working on. Then in June, I said that I would be posting some guidelines "in the coming weeks". Needless to say, I've been busy with other things. I am hoping to provide some basic guidelines on how to customize a ASP.Net GridView. I am no expert. The experts build components for retail use. Also, I've taken a server-side approach to the problem which is perhaps a little outdated with AJAX technology available. In my case, I use ......
That is, don't use Cassini in your development environment if you aren't planning to use it in production. For example, my customer is running IIS on their server. Why shouldn't I do the same? With what I have seen with Cassini, there is no reason. Cassini is great, but there are noticeable differences between it and IIS. I am using a third party menu that performs poorly through Cassini, but works fine on IIS. Others have documented differences in behavior with Cassini. Scott Lilly describes a couple ......
First of all, since my last post indicated I would be gone a while because of Huricane Ike, I guess it wouldn't hurt to provide an update. Well, I still have a little bit of work to do on the house, but things are mostly back to normal for me. There are still a lot of people in the Houston area recovering from the storm. I've personally helped clean up two homes that had water 4-5 feet high on the first floor. This makes me all the more glad that I am on the north side away from the storm surge. ......
I recently added a new page to my application that is very similar in behavior to a page I had already completed a couple months back. In fact, the similarities propagate down through the business and data layers as well. Because of this, I was able to introduce some base classes to limit duplication. In fact, I started all of this with a generic base test class. All of the base classes (with generics) were pretty straight forward. However, generics wouldn't help me when it came to the UI (aspx). ......
Posted On Monday, July 28, 2008 5:17 PM | Comments (0)
Filed Under [ ASP.Net ]
I've had a few people ask me about my custom GridView and whether I can help them with theirs. Though, I cannot share my code directly, I can provide some guidelines. In the coming weeks I plan to post segments stepping through customizing a GridView. My customizations are by no means perfect, and I have had to tweak things as I encounter issues. I look forward to sharing my experiences. I will probably post a multi-part article that walks through customizing a GridView. Again, I will not be posting ......
Posted On Monday, June 9, 2008 9:24 AM | Comments (0)
Filed Under [ ASP.Net ]
I've have been pretty quiet lately. Actually, I've been quite busy and it turns out that there isn't much new to share. However, this is one thing that comes to mind. A recurring pattern in my UI is selection criteria that can applied to a GridView. It turns out that frequently the same criteria applies to various screens. I use LinqDataSources to bind to DropDownLists for many of the criteria. It is not uncommon to use one controller for every page. Following this approach, I ended up with the same ......
In a recent post, I mentioned that I was working on a customized grid view. Last week I completed the "binding to user settings" behavior. Then I took a look at the source and was stunned. I had almost 700 lines of code (and comments) and it wasn't well organized. So, I set out to start adding regions to the code to separate different behavior. The last sentence should have raised some flags. Regions to separate behavior? What happened to the cohesion of my grid view? I seem to have lost sight of ......
How many times have you written something like this? 1: public string MyStringProperty 2: { 3: get 4: { 5: object s = ViewState["MyStringProperty"]; 6: if( s == null ) 7: { 8: s = "MyDefaultValue"; 9: } 10: return (String)s; 11: } 12: set { ViewState["MyStringProperty"] = value; } 13: } 14: 15: public bool MyBooleanProperty 16: { 17: get 18: { 19: object b = ViewState["MyBooleanPropert... 20: if( b == null ) 21: { 22: b = true; 23: } 24: return (bool)b; 25: } 26: set { ViewState["MyBooleanProperty"] ......
So, I decided to put my custom GridView in a AJAX UpdatePanel. This was my first serious exposure to AJAX (asp.net). I discovered that I was having major problems. I kept getting an "unspecified error". Because it occurred whenever I clicked on a row, I assumed it had to do with the JavaScript I wrote for the GridView. I did tons of web searching about how to properly use script in a controlled wrapped in an update panel. I tried a few things, including embedding the script and registering the script ......
A few nights ago I decided to work on a custom GridView. My goal (derived from a customer request) was to build some additional behavior into the GridView without having to write a whole bunch of client-side or code-behind code. These are the things that I am focusing on: Select a row when the user clicks on it (no CheckBox) Allow the user to select multiple rows (using Shift and Ctrl keys) Bind display settings to site preferences Column header text Bind display settings to user preferences Columns ......
Posted On Friday, March 7, 2008 1:28 PM | Comments (2)
Filed Under [ ASP.Net ]
So, I learned something new yesterday. I haven't spent a lot of time in ASPX over the last couple of years, and when I did I didn't really pay attention to what is new. Well, I learned about the nifty DataSourceControl classes. In my case, I decided to use the LinqDataSource control. And I put it to use on a nested GridView with Paging I struggled for more hours than I care to admit to accomplish what I wanted. In the end, I was pleased at just how little code was required. Check out my full article ......