Back in September last year (2008), I posted a demo about Username Availability Validator Control. This control developed by the community on a contest initiated by Dave Ward on August 2008 as I remember. At that time the control was in beta.
On October 2008 the control was released to public on its first version. And finally I wrote a a very simple documentation on the project Wiki.
In this post I am going to update my previous demo as well as provide new feature on the control which is SuccessMessage property to be displayed if the Username is available. This update is not available so far on project at CodePlex. This is a private update which I provided on this post only. [View Demo]
More...
I got many feedbacks in my previous posts "Building a grouping Grid with GridView and ASP.NET AJAX toolkit CollapsiblePanel" & "GridView Grouping Master/Detail Drill Down using AJAX and jQuery" asking to for toggle all (Expand All or Collapse All) feature in CollapsiblePanelExtender as well as to in jQuery. Actually I didn't have much time to walkthrough this and provide a demo about it.
Today I got a chance to write few code snippet to run this feature. It was very simple for both jQuery also for ASP.NET AJAX.
More...
Information About the book:
Book Title: Entity Framework Tutorial
Chapters: 8
Type: Tutorial
Publisher: PACKT Publishing
Author: Joydip Kanjilal
Introduction:
Since the release of .Net 3.5 SP1 & VS.NET 2008 SP1 which include Entity Framework v1 I started to play with EF and discover its usage and differences between it and LINQ to SQL.
Last month I got a change to have a book that walks through Entity Framework by tutorial. This book was Entity Framework Tutorial. The books itself is very small. It has a clear focus and scope; to put you on the road on how to build & use Entity Model of Entity Framework following comprehensive tutorials.
About Entity Framework Tutorial Book:
The book is small one, 228 pages on 8 Chapters. This books is targeting beginners who never used or even heard of Entity Framework. But of course the reader should be experienced developer with Microsoft .Net (general), ADO.NET & C#.
More...
I received an invitation to create first Egyptian Twitter like community on Yonkly.com. Thanks to Emad Ibrahim Creator and Founder of Yonkly.
Before I go further; you might ask What is Yonkly? My answer is: it is an enhanced twitter like mini blogging service. It is an open source project based on ASP.NET MVC. It is one of the first projects developed with early preview releases of ASP.NET MVC. This project was developed by Emad Ibrahim.
More information about Yonkly can be found at http://www.emadibrahim.com/category/yonkly/. You can download bits of this project from CodePlex.
2 different flavours of Yonkly are available through Yonkly.com, and Yonkly.net. The public Twitter clone is available at Yonkly.net, this is exactly like twitter with additional features like Groups. The other flavour which I am going to call community like edition is available under Yonkly.com. At Yonkly.com you can create your own community like Egyptian Yonklies I just created for Egyptian Tweeters. Both are in Beta as ASP.NET MVC itself is beta. Currently it require an invitation to be able to create your own network under Yonkly.com.
I think what is available on Yonkly.net should be available for each network under Yonkly.com. But this is something Emad should decide.
Today I was exploring Yonkly features while I was setting up egyonklies.yonkly.com. I was amazed by the provided features which I am sure is going to be enhanced and improved upon the release of ASP.NET MVC and in the upcoming releases of Yonkly.
More...
Before I start on this, I am sure I am not going to full fill all what I want to express about NDepend. NDepend takes your to the deep dark corners of your code and lights up those bright corners in it. Thanks to Patrick Smacchia and all this product development team for such great tool.
What is NDepend?
I don't think I can explain better than what is written in its web site:
"NDepend is a tool that simplifies managing a complex .NET code base. Architects and developers can analyze code structure, specify design rules, plan massive refactoring, do effective code reviews and master evolution by comparing different versions of the code.
The result is better communication, improved quality, easier maintenance and faster development."
So it is a massive code analysis tool, analyse every aspect of your code and produces informative reports with detailed matrices, diagrams and charts that should help you improve your code.
NDepend also generate and HTML report with all code analysis made alone with matrices and attached diagrams, figures and charts. One good thing I loved about this report, is when I found a term that I don't understand there is a link that takes me directly to online help where this term is defined. This helped me a lot, because some terms I am not familiar with, maybe my English or I am bad Engineer :o), either reason, it helped me and sure would improve any of those 2 defects in me :o).
Not only NDepend gives you these reports about your analysed code, but also it allows your edit constraints on and queries that produce these reports.
More...
I posted about how to build and extender control using ASP.NET AJAX with jQuery. During my work I fall into few issues that I resolved and wished to share them with you.
These issues are related to callback functions in jQuery. For example when calling slideUp(speed, callback) or slideDown(speed, callback). Same thing when calling each(callback) function except that the callback in each(callback) function takes 2 arguments while those in Effects functions take no arguments by default -refer to jQuery documentation for more details-.
What are the issue exactly?
In all callback function in jQuery, "this" keyword will reference the DOM Element. For example in slideUp or slideDown functions if you specified a callback like this:
//Collapsed is your callback function
$('#elementId').slideDown(Collapsed);
Your callback function Collapsed should look like this:
function Collapsed() {
//"this" refers to dom element
}
Now if you used "
this" keyword in the callback function context it will reference the DOM Element which you are sliding down or up or making any kind of effects on it.
More...
Me and Amr Elsehemy are working together in something and he requested a feature in some APIs I built. In fact he liked the Rob Conery's PagedList that had been modified by Troy Goode. He used it on his jBlogMVC post series about building Blog Engine using MVC.
That was pretty simple and I noticed something missing on the PagedList that I wished to add! What about sorting. I mean build a PagedList that is sorted. So I made slight changes to the enhanced PagedList made by Troy to support sorting.
Prerequisites:
It is required that you refer to Rob Conery's PagedList and the modified version by Troy Goode before you proceed in order to understand how this PagedList is useful and helpful with MVC and LINQ to SQL as well as LINQ to Entities.
Summary of changes:
To summarize the changes I made, simply I used Lambda Expressions to enable sorting. And had to modify Class declaration (with constructors) and the Initialize method. Sorting is provided by OrderBy extension method. Please return to method documentation for more details.
More...
In the previous part I talked about how to build the client control. In this part I'll show how to put it all together to build an ASP.NET AJAX Enabled Server Control. You can view the demo that demonstrate control usage here.
The good thing about ASP.NET AJAX is that it supports fully programmable interface for both Server and Client control. And make a connection between both control. So you just need to put the control declaration on the ASPX page and ASP.NET will make it work for you. On the other hand, you have full access to the client APIs so that you can do some manual calls to the client APIs as well.
Building the Server Control:
This is an ASP.NET AJAX Extender control. Means it extends existing ASP.NET control to enable ASP.NET AJAX on it. In this case this extender extends ASP.NET Panel control, that is why it is called CollapsiblePanelExtender. Here is an article to show you in details How To build Extender Controls.
Basically jQueryCollapsiblePanelExtender I am building here inherits directly from ExtenderControl. This required to implement 2 methods GetScriptDescriptors and GetScriptReferences which I am going to explore later. But now, I want to take your attention that I am using jQuery, and I wanted the developer to have the option to specify the path of the jQuery library. If he/she did not specify the path, the default path is used, which is the the one hosted by google at http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js. To do that I made a property and Call jQueryScriptPath that gets and sets jQuery javascript library path.
More...
At the end of the last month (September 2008) Microsoft announced that it will be shipping jQuery with Visual Studio going forward. It was a great news for all ASP.NET developers who are jQuery fans as well as jQuery and ASP.NET AJAX folks like me. Before and after that, there were many posts made around the same subject. It will take a full post to list all these posts. But it would be easy for me to list ASP.NET jQuery heroes around such Rick Strahl, Dave Ward and Matt Berseth. There are many other heroes around such as Bill Beckelman who made a great collection of ASP.NET with jQuery Demos.
For specific posts around ASP.NET AJAX and jQuery I recommend to refer to the following posts by Dave Ward's blog:
Introduction:
We all heard about and maybe worked with ASP.NET AjaxControlToolkit! A set of wonderful controls, but they are heavy, maybe not all of them but many of of them. Beside they require lots of script files which increase the response size.
I was thinking of building jQuery UI Widgets to clone some of AjaxControlToolkit controls. And after Microsoft announcement about jQuery I had another idea! I always liked how ASP.NET AJAX component model, both client and server models. It is easy to build ASP.NET AJAX Enabled Controls especially for ASP.NET control developers. ASP.NET AJAX client and server architecture really ease the development ASP.NET AJAX Enabled Controls and also the core ASP.NET AJAX client library has no massive performance issues, and it is widely used.
On the other hand, I loved the ease of using jQuery as well, how fancy it provides UI Effects and manipulation of DOM. Many many things I wished to have in ASP.NET AJAX were exist in jQuery. So I though of building an ASP.NET AJAX Enabled Control to clone the existing AjaxControlToolkit's control CollapsiblePanelExtender. And use ASP.NET AJAX client and server component model while using jQuery for UI Effects. In this case it would be collapsing (Slide Up) and expanding (Slide Down). [View Demo]
More...
On part 1 and part 2 I explored how to apply 2 different inheritance models (TPH & TPT) in Entity Framework. In this part I'm going to demonstrate associations between 2 base entities. And how to filter end properties to return specific type (sub entity). Download the sample.
Review Association Ends:
In previous part when I added department tables to the entity model diagram, an associations between Person and Department entities was automatically defined. This relation actually demonstrate the relation between Administrator and Department. It is one-to-many relationship where one person can be administrator of one or many departments.
A collection of Departments is created on Person table and therefor it is inherited on all sub entities! But this make no sense, as a student or instructor has nothing to do with this collection. Beside on the other end at Department a property of type Person is created -I renamed it to Administrator-, while this shouldn't be just any Person, this Person must be of type Administrator.
A few modification should take place in here. The existing association should be deleted and the association ends should be define between Administrator Entity and Department Entity. To do that follow the following steps:
More...
In the previous part I discussed Table-per-Hierarchy Inheritance, in this part I'll go through Table-per-Type Inheritance model. There is a video demonstrating this model if you wish to watch. Here I'll update my previous sample with new entities that demonstrate the Table-per-Type Inheritance model. For the differences between 2 models and definitions return to 1st part. The updated sample can be downloaded from here.
How to define a model with Table-per-Type Inheritance:
At the beginning I'll explore the database design for this subject, and explain why Table-per-Type must be used to model the inheritance:
More...
In this multi parts series I'll explore how to build inheritance with Entity Framework showing 2 different approaches of inheritance in Entity Framework. Beside that I'll show how to build simple association between 2 entities and show how to provide custom code to retrieve other parts of the relation when inheritance is applied.
My plan not to exceed 3 parts as the subject is not that huge, it is just the demonstration with screen shots that will make the post large that is why I divided it to multi part. I am not good at screen casts beside I don't have a software license to produce one.
Inheritance Types in Entity Framework:
There are 2 models of Inheritance in Entity Framework and they both actually depends on the database design:
- Table-per-Hierarchy Inheritance: One table in storage to maintain data for all the types in an inheritance hierarchy. So basically you have one table in database, but different types in your Entity Model that inherits from a base class and all mapped to that table. This post will focus on this type of Inheritance.
- Table-per-Type Inheritance: Separate table in storage to maintain data for each type in the inheritance hierarchy. That means you might have several tables with one-to-one relationships. Each table is mapped to single Entity in the model. But there is a base Entity that is mapped to the very base table. This is going to be the subject of my next part of this short series. Till then you can watch this video about it.
About the Sample:
The sample I am going to demonstrate here with screen shots is taken from MSDN sample in the links specified above. I found them much clear and easy to demonstrate beside I wasn't able to come out with much simpler sample idea.
More...
Amr Elsehemey started to blog about ASP.NET MVC. He picked up a good subject to blog about; Building ASP.NET MVC Blog Engine using ASP.NET MVC and jQuery, he named it "jBlogMvc" Yesterday he posted his first post in the series, and myself I am waiting for the rest of the series as for it is going to be very interesting, because I have couple of ideas in mind.
He is going to explore the code and posting samples as he developing this simple blog engine. We have been talking about this subject for few days now, and really he has some cool ideas to present. Keep tuned with Amr, I am sure he is going to amuse us with some kicking posts just as he did in his Design Time Support post series.
UPDATE: ALWAYS DOWNLOAD LATEST SOURCE CODE FROM PROJECT PAGE ON CODEPLEX
Few weeks ago Dave started the Advanced ASP.NET AJAX Server Controls book giveaway contest. And yesterday he announced that the control is almost completed, but the contest door is still open. So I thought to grape the bits and start testing it and build a simple sample. [View Demo]
The sample that I am going to demonstrate here will use ASP.NET Create User Wizard control with UserName Availability Validator. In this sample I'll show the important properties of this control as well as the current issues exist.
Prerequisites:
I'll assume that you already know how to configure and use the existing built in ASP.NET Membership provider. You'll need a sample database with ASP.NET Membership services installed on it.
The sample provided has ASP.NET Membership already installed and configured, you can download the sample and start explore it.
You page must have ScriptManager control on it, of course this is an ASP.NET AJAX control at the end.
More...
I've been worked with localization and globalization for a while now. During that period I faced issues and learned many things about the subject. Here I am going to share some of my own ideas and tips to avoid falling in certain issues. It worth to mention that I am talking from GUI point of view and not Application Data point of view.
Consider using Resource Files ".resx" or Database:
Well this is a matter of your needs. But I highly recommends to always consider ASP.NET Resource Provider. Then it doesn't matter to work with ".resx" of Database. By default ASP.NET has a provider for XML based resources which is resource files ".resx" But also you can get a great Database Resource Provider for free from here.
Actually to choose between both you should think about that all your UI localizable terms should be stored in one central location. I mean, do not put some in resource file and some other in Database. Like you define labels on resource files and grid headers in database!! or maybe error or information messages. Just build it right from the beginning and define one central location.
More...