Sunday, November 26, 2006

Project management

For thoes who have asked about a resource about project management, I should say pealse take a lool at the followling book which is one of the best books about software development (not specifically project management) which widley uses these days: 

 Working with Microsoft (r) Visual Studio(r) 2005 Team System (Paperback)

You need to have enough exorince about softeware development processes before reading this book(my recommendation)

This book is translated in some languages. (I never heard about its farsi translation yet)

Posted by Ahmadi at 00:22:40 | Permanent Link | Comments (5) |

Friday, August 18, 2006

Creating ATLAS application (Part 2)

Ok, back to blogging again after a wonderful trip to Canada :)

In this sample I'm going to create a Gridview and bind it to a set of records coming from AdventureWorks DB.

Note: AdventureWorksDB is the sample database in SQL Server 2005. Obviously you can connect to any other database which you may prefer.

First let's create structure of our work. I recommend let's have a dropdown list which shows the product subcategories and a grid which depending to selected product subcategory, shows bunch of related products. As you guess the code will be really simple and is not dependent to ATLAS, so I just put the code here without additional explanation.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Atlas.aspx.cs" Inherits="Atlas" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

    <title>Untitled Page</title>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <asp:SqlDataSource ID="sdsDDL" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString %>" SelectCommand="SELECT ProductSubcategoryID, Name FROM Production.ProductSubcategory">

        </asp:SqlDataSource>

        <asp:DropDownList ID="DDL" runat="server" AutoPostBack="True" DataSourceID="sdsDDL" DataTextField="Name" DataValueField="ProductSubcategoryID">

        </asp:DropDownList>

        <asp:SqlDataSource ID="sdsGDV" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString %>" SelectCommand="SELECT Name, ProductNumber, ReorderPoint FROM Production.Product T WHERE (T.ProductSubcategoryID = @PSID)">

          <SelectParameters>

            <asp:ControlParameter ControlID="DDL" DefaultValue="1" Name="PSID" PropertyName="SelectedValue" Type="Int32" />

          </SelectParameters>

        </asp:SqlDataSource>

        <asp:GridView ID="GDV" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataSourceID="sdsGDV">

          <FooterStyle BackColor="White" ForeColor="#000066" />

          <Columns>

            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />

            <asp:BoundField DataField="ProductNumber" HeaderText="ProductNumber" SortExpression="ProductNumber" />

            <asp:BoundField DataField="ReorderPoint" HeaderText="ReorderPoint" SortExpression="ReorderPoint" />

          </Columns>

          <RowStyle ForeColor="#000066" />

          <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />

          <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />

          <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />

        </asp:GridView>

    </div>

    </form>

</body>

</html>

If you remember from the prior post; we have just started an ATLAS application and now we are ready to writ the code. In fact we could create ATLAS application WITHOUT writing EVEN one line of code-behind! How? Let see ;)

The first thing we need to take advantage of it, is an easy-to-use control which is responsible for partial-rendering. This control is ScriptManaget.

You can simply use this control right after your serer-side form tag. Don't forget to enable ScriptManager's PartialRendering attribute to true:

<form id="form1" runat="server">

  <atlas:ScriptManager runat="server" ID="asm" EnablePartialRendering="true" />

  ..

</form>

If you create the above page and make it run, you'll see, when user changer the selected product subcategory via dropdownlist, the page posts back and then ONLY the gridview's data changes (rebinds). So we can say that in our example the gridview control is the only updating control after post backs and this will give us an idea about putting this control inside a ATLAS control named "UpdatePanel". By design UpdatePanel is responsible for updating the controls inside it in very specific time. As you guess we should place our gridview inside an "UpdatePanel" like this:

<atlas:UpdatePanel runat="server" ID="aup" >

  <ContentTemplate>

    <asp:GridView ID="GDV" ... >

    ...

  </ContentTemplate>

</atlas:UpdatePanel>

But how can we enforce the "UpdatePanel" to update the gridview with new server data depending on the value that has been selected by the user through the dropdownlist? The answer is simple. "UpdatePanel" control supports a collection called "triggers". In this collection you can simply enforce when "updatePanel" has to update its containing control(s). Its syntax is very easy and wonderful:

<atlas:UpdatePanel runat="server" ID="aup" >

  <ContentTemplate>

    <asp:GridView ID="GDV" ... >

    ...

  </ContentTemplate>

 

  <Triggers>

    <atlas:ControlValueTrigger ControlID="DDL" PropertyName="SelectedValue" />

  </Triggers>

</atlas:UpdatePanel>

That's it. Your page become ATLAS enables and behaves exactly as you expect from an equivalent AJAX enabled pgae!

As you noticed we never used any line of code-behind!!

Following is the complete code for the above sample:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Atlas.aspx.cs" Inherits="Atlas" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

    <title>Untitled Page</title>

</head>

<body>

    <form id="form1" runat="server">

    <atlas:ScriptManager runat="server" ID="asm" EnablePartialRendering="true" />

    <div>

        <asp:SqlDataSource ID="sdsDDL" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString %>" SelectCommand="SELECT ProductSubcategoryID, Name FROM Production.ProductSubcategory">

        </asp:SqlDataSource>

 

        <asp:DropDownList ID="DDL" runat="server" AutoPostBack="True" DataSourceID="sdsDDL" DataTextField="Name" DataValueField="ProductSubcategoryID">

        </asp:DropDownList>

 

        <asp:SqlDataSource ID="sdsGDV" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString %>" SelectCommand="SELECT Name, ProductNumber, ReorderPoint FROM Production.Product T WHERE (T.ProductSubcategoryID = @PSID)">

          <SelectParameters>

            <asp:ControlParameter ControlID="DDL" DefaultValue="1" Name="PSID" PropertyName="SelectedValue" Type="Int32" />

          </SelectParameters>

        </asp:SqlDataSource>

        <atlas:UpdatePanel runat="server" ID="aup" >

          <ContentTemplate>

                <asp:GridView ID="GDV" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataSourceID="sdsGDV">

                  <FooterStyle BackColor="White" ForeColor="#000066" />

                  <Columns>

                    <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />

                    <asp:BoundField DataField="ProductNumber" HeaderText="ProductNumber" SortExpression="ProductNumber" />

                    <asp:BoundField DataField="ReorderPoint" HeaderText="ReorderPoint" SortExpression="ReorderPoint" />

                  </Columns>

                  <RowStyle ForeColor="#000066" />

                  <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />

                  <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />

                  <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />

                </asp:GridView>

          </ContentTemplate>

          <Triggers>

            <atlas:ControlValueTrigger ControlID="DDL" PropertyName="SelectedValue" />

          </Triggers>

        </atlas:UpdatePanel>

    </div>

    </form>

</body>

</html>

Enjoy!

To be Continued

Posted by Ahmadi at 18:41:49 | Permanent Link | Comments (4) |

Thursday, July 13, 2006

Creating Atlas applications

In this post I'm going to describe a very simple way to make your own Atlas enabled application with ASP.Net 2.

Earlier we have discussed about AJAX and how to develop a pure AJAX enabled application with ASP.Net 1.1 and 2.0 without using any wrapper. As a personal point of view I should say I would love to develop my applications using pure technology, but sometimes it becomes more cost effective. On the other hand we have lots of time limitation issues from client side and also management side! These issues plus some others forces us to use third party components to achieve our goal by spending reasonable time and budget.

According to the above mentioned reasons, you may choose a third party component to develop you AJAX enabled application. But what if your budget was not enough or there where other political problems to buy an AJAX enabled third party component?

In this case one of the answers is using Microsoft’s Atlas which is you can find in Microsoft’s site. Make sure that you have read the system requirements in the same page. What we need is “AtlasSetup.msi” which is only 2.2MB. Of course that would be a great idea to download the samples and documentations as well.

Note: This post and any other posts in this blog are just for information and author is not responsible about any kind of potential possible problems of using any of mentioned third party components, materials, technologies and etc.

Ok. Let’s assume that you have installed Visual Studio 2005 or Visual Web Developer Express Edition (free download) - which are optional - on your machine and let’s start our application. Using one of above products if you have Atlas installed on your machine, when creating a new web site you’ll see that you have a new template added in your Visual Studio Installed templates named “Atlas” Web Site:


Opening above template will create a new Web Site which simply has a reference to Atlas assembly and relative changes in your web.config file. Any other files created by this project template is not mandatory and you can safely remove them to have a clean and ready to develop atlas web site.

To be Continued

Posted by Ahmadi at 17:38:23 | Permanent Link | Comments (1) |

Monday, April 17, 2006

VS2005 learning materials

 

Eventually today I found enough time to blogging but I just do a short one for the time ling.

I'm sure that you guys are browsing microsoft's web site regularly for new stuff and materials, but sometimes it happens for everybody to try more and find less. So I just do this post to give two amazing links to MSDN site! The first one is a link to VS2005 guided tour (Check it and watch the videos) and the next one is a link to a free eBook provided by Microsoft (Check it out because it dose't happen most oftenly).

And now the links:

1) Visual Studio 2005 Guided tour

2) Introducing Microsoft Visual Basic 2005 for Developers

Posted by Ahmadi at 05:33:35 | Permanent Link | Comments (2) |

Thursday, March 16, 2006

Migration!

I'm really sorry coz i was/am really busy these days about my migration to US.

Soon I will update regularly this blog.

 All the bests

Posted by Ahmadi at 05:15:59 | Permanent Link | Comments (2) |

Monday, February 06, 2006

Good News

Hey guyz, you know which jobs are big demanded and big paid these days?

According to CNN news, in tech jobs there are two jobs that they are in high demand these days are .NET (dot net) developers and quality assurance analysts.

"Developers who are expert users of Microsoft's software programming language .NET can make between $75,000 and $85,000 a year in major cities when they're starting out. If they pursue a job at a company that seeks someone with a background in a given field (say, a firm looking for a .NET developer experienced in using software related to derivatives) they might snag a salary hike of 15 percent or more when they switch jobs.

Those who work in software quality management, meanwhile, might make $65,000 to $75,000 a year and be able to negotiate a 10 percent to 15 percent jump in pay if they switch jobs."

You can see the full info in CNNMoney.

Posted by Ahmadi at 07:26:00 | Permanent Link | Comments (2) |

Thursday, January 26, 2006

Web Part

Guys, I'm proud to say that a friend of mine has developed a webpart for his company's purpose which is used to show the Current User information and all, finally when he finished it and refined it. He has sent it to microsoft's "SharePoint Products and Technologies Web Component Directory" and after the guys overther checked it they found that webpart is fairly useful and decided to put it in microsoft's website. For more information and/or download it, click here.

Congrats Mohammad

Posted by Ahmadi at 13:54:27 | Permanent Link | Comments (1) |

Wednesday, January 25, 2006

DasBlog

Guys today I'm just suggesting you to browse the sourceforge and look for DasBlog. DasBlog is an open source project which you can use to create a very nice blogging service in your web server. You can download it here.

Please check the source code and see how it's developers have made it with ASP.Net 1.1. You can get the idea behind it and also go beyond as well. So enjoy it :)

P.S. I hope that you can also download and use IE 7 and set it up on your machine, I'm sure if you are a crazy of using FireFox after you install IE 7, you'll never miss FireFox ;-)

Posted by Ahmadi at 11:17:16 | Permanent Link | Comments (2) |

Thursday, January 19, 2006

Site Navigation

Today I'm going to talk about one other new feature in ASP.Net 2.0.
Do you remember that how much of troubles we had, to make our site's navigation easy to use for our clients? If you did not, at least I'm still tired of that days.
If I forward you my students' emails you'll find how much of questions was about or related to using a treeview control or a menu control. They asked me for a FREE user control or a cracked one! which I did not have. So I just described them the situation and told them how to make a treeview user control and so on.
But now, let's thank ASP.Net team members because they solved the problem in ASP.NET 2.0 with a series of navigation-based server controls.
The thing that we need to create is a simple XML file and place our site map configuration in it, something like this:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
  <siteMapNode title="A" description="Page A" url="a.aspx">
    <siteMapNode title="AA" description="Page AA" url="aa.aspx">
      <siteMapNode title="AAA" description="Page AA-A" url="aa.aspx?cat=A"/>
      <siteMapNode title="AAB" description="Page AA-B" url="aa.aspx?cat=B"/>
      <siteMapNode title="AAC" description="Page AA-C" url="aa.aspx?cat=C"/>

      <siteMapNode title="AAD" description="Page AA-D" url="aa.aspx?cat=D"/>
    </siteMapNode>
    <siteMapNode title="AB" description="Page AB" url="ab.aspx">
      <siteMapNode title="ABA" description="Page AB-A" url="aba.aspx"/>
      <siteMapNode title="ABB" description="Page AB-B" url="abb.aspx">
        <siteMapNode title="ABBA" description="Page AB-B-A" url="abba.aspx"/>
        <siteMapNode title="ABBB" description="Page AB-B-B" url="abbb.aspx"/>
      </siteMapNode>
      <siteMapNode title="ABC" description="Page AB-C" url="abc.aspx"/>
    </siteMapNode>
    <siteMapNode title="AC" description="Page AC" url="ac.aspx"/>
  </siteMapNode>
</siteMap>

If we use this XML file and assign it to the data source property behind a couple of new site-navigation server controls, such as the TreeView and the SiteMapPath server controls. For example our treeview will be something like this:

The other control that we have talked about was SiteMapPath server control, actually this control shows the foot-prints of cilent's clicks to get the urrents page. Some guys call it navigation breadcrumbs, which I think comes from "Hansel & Gretel" story. By using this control client can see the path that he has taken in the application and can easily navigate to higher levels in the tree. See the following pic:


Okay, todays story has been finished. So try it use it and enjoy it as well.

Posted by Ahmadi at 13:33:49 | Permanent Link | Comments (0) |

Tuesday, January 03, 2006

GridView in ASP.Net 2.0

Excuse me for long delay in bloging!
In this articl as I promised before I'm going to introduce a new server control in ASP.Net 2.0.
So by using this control, you'll touch the simplicity and the power of ASP.Net to in advanced.
As you remember from ASP.Net 1.x, and maybe from my never written! lectures and the other bloggers and authors about DataGrid, we have found DataGird as a very felxible and powerful server side control which you can use for view and edit matrix data. It has some features like sorting and paging which by default are disabled and if you want to use those features you are supposed to write a little bit of code and eventhandler subroutins.
Aaaaaah no, I don't want to explain that simple code again and again and again, but I'm going to get the same result with a new ASP.Net 2.0 server control named GridView.
The following code will explain evrything more better than any extra comment, see:

<%@ Page Language="VB" %>
<html>
  <body>

    <form runat="server">
      <asp:GridView ID="gdvTest" Runat="server" AllowPaging="True"
        DataSourceId="sqlDsr" />

      <asp:SqlDataSource ID="sqlDsr" Runat="server"
        SelectCommand="Select * From Customers"

        ProviderName="System.Data.OleDb"
        ConnectionString="Provider=SQLOLEDB;Server=localhost;uid=sa;

        pwd=something;database=Northwind" />
    </form>
  </body>
</html>

Tha's it. Finished!

Yes, you're right, I used two controls instead of one DataGird, but can you tell me where is the eventhandlers which is required for PageIndexChanged event of a DataGrid? I mean the part that we used to write something like this:

Private Sub DataGrid1_PageIndexChanged(ByVal source As Object, _
ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs)
  DataGrid1.CurrentPageIndex = e.NewPageIndex
  'Rebinding the Datasource to the DataGrid1
  ...
End Sub

Cool, this part are not required for GridView ;-)

Did you enjoyed? So take care of using GridView ;-)
Posted by Ahmadi at 13:03:43 | Permanent Link | Comments (0) |