ASP.Net

There are 33 entries for the tag ASP.Net
A few weeks ago, I blogged about building an alternative to Dynamic Data. I have to say, it’s pretty sweet. I added a new entity type yesterday, including a couple of minor overrides and I was done. Here are the steps I had to take (testing left out for clarity): Create the entity: 1: public class ExcludedCounterparty : IAuditedWithId 2: { 3: public virtual int Id { get; set; } 4: public virtual Counterparty Counterparty {get; set;} 5: public virtual string CreatedByUser { get; set; } 6: public virtual ......
A couple of weeks ago I was searching for an alternative to Dynamic Data. My motivation was simple. Integrating Dynamic Data with Oracle and/or NHibernate would be challenging. I was amazed at how little I could find that would solve this problem. Surely Dynamic Data wasn’t the first or only. Eventually, I gave up and worked with a coworker to develop our own alternative. Fresh off a Fluent Nhibernate implementation, we decided to take the convention-over-configuration approach. The Fluent interface ......
About a year ago, I started to evaluate ASP.Net MVC, but decided to put it aside because it was still in heavy-duty development. With the official release a couple of weeks ago, I decided to check it out once again. MVC has a lot of things to offer, but there are a few critical things that we couldn’t overlook. We have a few web applications that all have quite a lot invested in server controls (both third-party and developed in-house). In ASP.Net WebForms, for something as simple as a GridView with ......
I few months back, I was having major problems with VS 2008 crashing on me left and right. After trying numerous things to resolve my problem, I finally decided to uninstall all of the .Net Frameworks and VS, then reinstall. My problems started shortly after I installed SP1 (both .Net Framework and VS 2008). I can’t say for certain that SP1 was causing my problems, but since then (after reinstalling without the service packs), I have not experienced the crashing. There are other reasons that I wanted ......
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 ......
My trial ran out a few days ago. And I haven't posted about R# for almost a month. I have to a few more things to share, and perhaps I can save everyone some time. The R# team has done quite a few small things to raise the tool a step above my expectations. There are a lot of things that may seem small, but really turn out to be significant improvements to the way I manage my code. Simple things, like, locating new code (via refactoring) with similar declarations (fields with fields, properties with ......
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 finally installed ReSharper yesterday to try it out. I've been dragging my heals because I didn't want to have to learn a bunch of new commands and pay for that right (I'm cheap, I know). Here are a few things I noticed immediately. Keep in mind that these are first impressions, and they are sure to change over the next couple of weeks. [Update] I turns out that ReSharper is not the culprit here. See this post for more details. TestDriven.Net broken after ReSharper install. Any time I attempt to ......
I attended the Houston TechFest today, and am now finding it difficult to sleep with all of the new knowledge and relationships filling my mind. I finally decided to get out of bed and put some of my thoughts in writing. The Fest was great. There are a few good reasons to attend an event like this. It's free. You get to meet new people with common interests. Employment opportunities are there if you are looking for them. You almost certainly learn something (if not many things). There are lot's of ......
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 ......
Today I was working on a WebForm that includes a GridView which presents text boxes for various columns. I put these in the ItemTemplate so all of the rows could be edited at any time. The next requirement was to update certain read only columns (e.g. Total Amount) based on the changes of the others. Originally, I had the entire GridView in an UpdatePanel, but that quickly proved to be a problem for two reasons. First, the updates were fairly slow. Second, the active control would lose focus after ......
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. ......
In Css and Custom Server Controls I talked briefly about a problem with the mark-up for my server controls being injected with &nbsp; after toggling to Design View. It was certainly something I could work around, but it was annoying nevertheless. I just couldn't see anything in my designer code that could cause the issue. Well, I recently reviewed the Visual Web Developer Team Blog about the multiple fixes included with VS 2008 SP1. Under the WebForm /HTML Design View subheader, there is an item ......
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). ......
I received quite a bit of feedback regarding my Join extension to IEnumerable that generates a comma separated list. The purpose was to emulate string.Join(), but to add more flexibility as to what is "joined". I took some time aside to investigate some of the suggestions and alternatives to my implementation. I should note, that I would not normally do this. I try to avoid premature optimization. However, there are certain practices that can be learned that improve performance in general (like using ......
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 ......
I'm clearly not the oldest knife in the drawer, nor am I the youngest. I got involved with computers in my youth just about the time Bill Gates was positioning himself to put a PC in every home. What this means is, I grew up on PCs with no mice; pre-Windows, pre-GUI. I learned how to write "menu" programs that utilized a broader range of ascii characters than most people are familiar with today. The point is, everything I did on the computer I did with the keyboard. I recall in high school, a new ......
I guess it's about time I've posted again. I've been very busy. Just coming up for air for a bit. I've been mixing some CSS design patterns with Server Controls recently. Aside: A nice book about CSS design patterns is Pro CSS and HTML Design Patterns. It is very helpful in understanding how the boxing models work and it provides a lot of practical examples. Anyway, copy-paste reuse easily gets out of hand on a web project. It's not always easy to refactor HTML. Anyway, I have many pages that use ......
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 ......
C# 3.0 has certainly introduced some really cool features. I have used the Automatic Properties extensively as well as object and collection initializers. These are real time savers. However, the most exciting feature (IMHO) are Extension Methods. My last post shows one example of how powerful extension methods can be. Here is another example (inspired by Scott Gu). 1: public static class Extensions 2: { 3: /// 4: /// Do not use this extension for large sets because it iterates through 5: /// the ......
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 ......
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 ......
I received the "okay" today to develop our new application in .Net 3.5. This is really great news. I am looking forward to taking advantage of some of the new technologies available. In particular, I will be checking out the MVC Toolkit that Microsoft offers as an add-on. I have implemented MVC/MVP in previous versions of ASP.Net. The experience was cumbersome at best. The real issue I had is that it was really difficult to move the appropriate pieces out of the view and that the view knew too much ......