Geeks With Blogs
AzamSharp Some day I will know everything. I hope that day never comes. February 2008 Entries
Silverlight Runtime Installation a BIG MESS!!!!!!!!!!!!!!!!
I created a simple XAML file and was trying to host it in an ASPX page when I was greeted with the following screen. That's interesting because I am pretty sure I had the Silverlight Runtime installed. Anyway, I clicked on the link and downloaded Silverlight. Once, the installation was finished I simply tried to refresh the page but that did not worked out. So, I closed all the browsers and open IE again but same message again that Silverlight is not installed. Finally, I restarted the machine but ......

Posted On Tuesday, February 26, 2008 4:35 PM

Drag And Drop With Persistence Using JQuery

I have just published a new article "Drag And Drop With Persistence Using JQuery" in which I explained how to drag and drop users to the drop zone. The data is also persisted in the database.

I hope you enjoy the article!

Posted On Tuesday, February 26, 2008 12:57 PM

ASP.NET MVC Controller And Action Role Authentication
Today, I was playing around with ASP.NET MVC Framework when I came to an interesting situation. I was displaying Categories from the Northwind database as ActionLinks. When clicked on the link it will popup a confirmation box asking whether you want to delete the item or not. Here is the code to display the link and the confirmation box: <% foreach (var category in ViewData) { %> <%= Html.ActionLink<Category... => c.Delete(category.id), category.CategoryName, new { onclick ......

Posted On Sunday, February 24, 2008 4:06 PM

ASP.NET MVC in Action Available Through Manning Early Access Program

The first three chapters of ASP.NET MVC in Action are now available through the Manning Early Access Program. I am proud to announce that my friend Ben Sheirman is also one of the co-authors of the book (Awesome work Ben!) working with Jeffrey Palermo and Dave Verwer.

Keep up the good work and eagerly waiting for the book.

Posted On Saturday, February 23, 2008 2:08 PM

Advertise on GridViewGuy

If you are attempting to give your business more exposure and substantial revenue, we at GridvewGuy are willing to help!
GridviewGuy is looking for people who would like to advertise their business on this fast growing website with over a million page viewers every month.

Advertise on GridViewGuy

Posted On Saturday, February 23, 2008 9:00 AM

Using JQuery to Add Drag and Drop Support
Drag and drop support in a web application always get some attention. I used drag and drop support in one of my applications and I have to admit that it involved a lot of JavaScript code. You can check out the article "Browser Compatible Drag and Drop Shopping Cart". Today I had to create the same drag and drop approach so I decided to check out the drag and drop API's of the JQuery library. I have to admit that JQuery is one of the best JavaScript library that exists today. I can go on and on with ......

Posted On Thursday, February 21, 2008 4:45 PM

Use AS Keyword When Giving Alias to Columns (T-SQL)
Yesterday, I was working on a page and for some reason it was not returning the correct results. I checked the stored procedure and everything was there. It was a much bigger stored procedure which was returning integar values but here is a small example. SELECT [id],CategoryName Description from categories Initially, when I checked the results using the UI it seemed like the CategoryName is messed up since it is returning strange results (even though only the name of the column was changed to Description ......

Posted On Thursday, February 21, 2008 6:15 AM

HTML Formatting: GridView Vs Datagrid Control
A few days ago while working on a project I had a requirement to display the GridView control with one of the columns as a hyperlink column. The AutoGenerateColumns must be set to true since the columns of the GridView were not fixed. Here is the code I used to create links inside the GridView as well as the Datagrid control. <h3>GridView</h3> <asp:GridView ID="gvCategories" runat="server" onrowdatabound="gvCategorie... </asp:GridView> <br /> <br /> ......

Posted On Thursday, February 21, 2008 5:13 AM

Multiple Repositories/Managers vs Method Invoker
I have been using Repositories and Managers for some time now. Repositories allows you to perform actions on the entities which include the basic CRUD operations and also other retrieval functions. If I am developing an application I will have repositories for all my root types. This means if I have Person and Address entity then I will have the PersonRepository which will persist the person as well as the address. Recently, I am inclining towards a completely different approach. This approach is ......

Posted On Wednesday, February 20, 2008 4:33 PM

My Upcoming Articles on GridViewGuy
I have been pretty busy lately. But anyway here is the list of my upcoming articles on GridViewGuy. I will update the links when the articles are published. 1) Unit Testing Membership and Role Providers in ASP.NET 2.0 2) URL Rewriting Using ASP.NET MVC Framework 3) Dynamic Data Support in ASP.NET 3.5 Framework 4) Extension Methods 5) Using Cache Attribute to Cache Methods Stay tuned on www.gridviewguy.com :) ......

Posted On Monday, February 18, 2008 5:22 PM

The KISS Approach!
The KISS (Keep It Simple Stupid) approach dictates that a developers should keep the design of the application simple. I am not sure if I understand it completely. I mean what does SIMPLE mean. Does that mean I should start writing my data access code in my code behind pages? Or does that mean I should use DataSets and DataTables as my data carriers. I worked on couple of applications where the application started off very cleanly with few basic requirements like make a form that can insert data. ......

Posted On Monday, February 18, 2008 5:01 PM

Video: Introduction to LINQ

I just published a new video on www.gridviewguy.com. In this video I demonstrates how to get started with the LINQ framework. Check it out using the link below:

http://www.gridviewguy.com/ArticleDetails.aspx?articleID=378_Introduction_to_LINQ

Posted On Monday, February 18, 2008 1:24 PM

Caching Ajax Requests on the Browser
I am reading this awesome book "Building a Web 2.0 Portal with ASP.NET 3.5" by Omar Al Zabir. Omar talks about caching the Ajax requests on the browser cache. This will improve the performance since the request will be handled directly from the browser cache without contacting the server. Let's take a very simple example. Let's say you have a DropDownList which displays the categories .When the user selects the categories you display all the products in that category. You are making an Ajax call ......

Posted On Sunday, February 17, 2008 4:38 PM

Data Caching Using Custom Attributes
Data Caching allows you to hold the items in the memory (Cache) so you don't have to access the database on each and every request. A common pattern when performing data caching is shown below: if (Cache["Rooms"] == null) { // get the rooms var rooms = from r in virtualRoomDC.tblRooms select r; Cache["Rooms"].Insert("Rooms", rooms); } return Cache["Rooms"] as IEnumerable<tblRoom>; First, we check if the Cache[Key] is null or not. If the Cache[Key] is null then we ask the database for the items. ......

Posted On Saturday, February 16, 2008 10:09 AM

Suppressing and Handling Errors from the Update Panel
Today, I was working on an application that required some Ajax magic. I had a very basic scenario set up in which I was simply inserting the database into the database using a simple form. I had some validation rules setup for my domain objects. If the validation rule was broken an exception was thrown and Global.asax Application_Error event caught the exception and uses Response.Write to write the exception on the screen. The problem occurred with the Response.Write method. Since, Response.Write ......

Posted On Thursday, February 14, 2008 2:57 PM

Unit Testing Role Providers in ASP.NET
Some time back I blogged about unit testing Membership Provider "Membership Provider and Unit Testing" as it turned out I was missing the unit tests for Role Provider. In this post I will explain how to unit test the Role Provider. First of all here is the implementation of the role provider. public class VirtualRoomRoleProvider : SqlRoleProvider { private NameValueCollection _roleConfig = new NameValueCollection(); public VirtualRoomRoleProvider() { _roleConfig.Add("applicatio... "VirtualRoom"); ......

Posted On Tuesday, February 12, 2008 8:48 AM

Three New Videos on GridViewGuy
I just published three new videos on www.GridViewGuy.com. Check out the links below: Adding Multiple Rows to the GridView Control Anonymous Types in the .NET Framework Object and Collection Initializers I hope you enjoy the videos ......

Posted On Tuesday, February 12, 2008 6:45 AM

New Poll: Will your DBA allow you to use DLINQ?
DLINQ stands for Data Language Integrated Query allows you to quickly create entity classes and relationships using your database schema. Not only that but DLINQ provides very useful methods when persisting the data into the database. You can create the relationships using the designer. The designer will write all the code for you. Finally, when you need to persist the object into the database you call few methods and DLINQ takes care of the rest. DLINQ is designed with RAD (Rapid Application Development) ......

Posted On Sunday, February 10, 2008 8:21 AM

Who is this old bag? Oh wait that's me! Just turned 27!

Happy Birthday to me!!

Posted On Saturday, February 9, 2008 3:28 AM

New Article: Adding Multiple Rows in the GridView Control

I just published a new article "Adding Multiple Rows in the GridView Control". I hope you enjoy it!

Posted On Thursday, February 7, 2008 5:04 AM

Adding Multiple Rows to the GridView Control
Yesterday, I received an email from a user who wanted to know how to add multiple rows to the GridView control. This means that you can add any number of rows using the "Add" button and the rows will append at the end of the GridView control. Let's first populate the GridView control. private void BindData() { NorthwindDataContext northwind = new NorthwindDataContext(); gvReport.DataSource = GetProducts(); gvReport.DataBind(); } private List<Product> GetProducts() { NorthwindDataContext northwind ......

Posted On Wednesday, February 6, 2008 6:09 AM

Creating an Online Exam Using LINQ to SQL Classes Part 2
Long time ago I posted an article "Creating an Online Exam Using LINQ to SQL Classes Part 1" in which I explained how to get started with creating a very simple online exam. I just posted the Part 2 of the article which covers unit testing of the application ......

Posted On Tuesday, February 5, 2008 8:58 AM

Copyright © Mohammad Azam | Powered by: GeeksWithBlogs.net