Dec 23 2006

My web Pages Starter Kit

Category:Bil@l @ 21:42

Page Header (click for full size image)

 

The final version of the ‘My Web Pages Starter Kit’ is available on www.codeplex.com/MyWebPagesStarterKit.

With the new My Web Pages Starter Kit you can easily create and manage your own website. It enables customers to set up and maintain websites through a browser based administration interface. This full-fledged Content Management System is open source and freely available. It is composed of modules and easily extensible. Join in and test it yourself!

1-2-3

1.  Easy to get the My Web Pages Starter Kit

2.  Easy to customize with the Microsoft Visual Web Developer Express Edition (This is optional - you may just use the kit out of the box)

3.  Easy to deploy at an ASP.NET 2.0 hoster

Tags:

Dec 14 2006

Themes and StyleSheetThemes

Category: ASP.NET 2.0 - ThemesBil@l @ 11:18

A note about Themes and StyleSheetThemes:

When you are using a theme, the SKIN files in the Theme folder, will have precedence over the properties you define on a control on a page.

When you are using CSS files in the Theme folder, the properties defined on the control in the page will take precedence over any CSS defined in the Theme folder.

Regards

Tags:

Dec 14 2006

How to Handle Relative Paths in Master Pages

Category: ASP.NET 2.0 - Master PagesBil@l @ 07:24

While reading ASP.NET 2.0 Unleashed by Stephen Walther, I found out a nice trick about relative paths in Master Pages.

If you are using Relative Paths and you are using ASP.NET controls in your master pages, then the paths are relative to the Master Page file, while if you are using HTML controls, the paths are relative to the content page and not master page.

So it is better to use ASP.NET Controls always, but if you still insist on using HTML controls with relative paths, then you can do a small trick and make the paths relative to the master page and not content page as follows:

<img src='<%=MasterUrl("Logo.gif") %>' alt="Website Logo" />

As you can see we are using an "img" tag with the source calling a server side method that fixes the path to be relative to the master page and not to the content page as follows:

public string MasterUrl(string url)
{
     return string.Format("{0}/{1}", this.TemplateSourceDirectory, url);
}

The url is being formatted in such a way to start from the forlder where the master page is placed and append to it the path of the image!

Hope this tricks helps! Thanks Stephen!

Regards

Tags:

Dec 9 2006

Most Popular Articles on ASPAlliance.com - Part 2

Category:Bil@l @ 18:48

Day after day I am getting to be surprised more and more by the amount of effect my articles are leavingn on my readers from all over the world!

Today I was visiting my publisher site to find out that 3 of my articles are having places in the top 5 most viewed articles:

  1. How to Popup a Window Using DIV Layer in ASP.NET 1.x/2.x - 2nd Place
  2. Extended GridView Control - 3rd Place
  3. Smart ListControl in ASP.NET 1.x/2.0 - 4th Place

Thank you all for reading my articles and supporting me this much!! I am so grateful!

Regards

Tags:

Dec 8 2006

Handling NULL Columns when updating

Category: ASP.NET 2.0 - General | Databases & SQLBil@l @ 16:49

Another tip from the great book by David Sceppa is how to handle null column values:

Suppose you have a column in your table in the Database, and that column can have NULL values, the column is named ColA. Now you wanted to updated a record by checking if ColA is NULL in the WHERE clause to allow updating:

UPDATE ..... WHERE ColA = ?

The above won't work if the value of ColA was NULL and the value of the parameter is NULL, instead you should use:

 "ColA IS NULL"

However, to write a SQL Stored Procedure that allows columns with allowed NULL values to accept values either NULL or something else, you should change the above statement to something as:

UPDATE ... WHERE (ColA = ? OR ((ColA IS NULL) AND (? IS NULL)))

This means, we want the above statement to be true when ColA equals the value of "?" or when ColA is  NULL and the ? is also NULL. Why is that?

Suppose you want to update a record where ColA == 5, therefore, the above statement will be true, the query will search for the record whose ColA value is 5. This is fine!

Now suppose, you want to update a record where ColA is null, so you provide NULL for the value of ?, then the query will search for the record whose ColA is null, the first part of the WHERE will fail, but the second part will succeed, since we are ORing, then the conditions will pass!

Suppose, you want to update a record whose ColA == 6, and it happens that a record in the table has the value of ColA as NULL, and then you execute the query, it will also succeed in not updating the record whose ColA is null, because we have added the second ANDing condition, (? IS NULL). So, if you wanted to update a record whose ColA value is 6, and while running the query you passed through a record whose ColA is NULL, it won't be updated, because we have to check too, if the ? is NULL, if not NULL, then the update will not work, and hence the query works great, because in the second condition, only the first left side wins, but the second right side it fails, because the value im searching for which is 6 is not NULL.

Hope this helps!

Regards

Tags: ,

Dec 8 2006

Concurrency in ADO.NET

Category: ASP.NET 1.xBil@l @ 14:27

During my reading to the Microsoft ADO.NET Core Reference by David Sceppa I am getting to learn so many things, among which ways to handle concurrency Options:

1- Include only the Primary Key Columns
This way, when User A and User B both read the same record at the same time, when it comes for updating the record, the last who updates wins, since no way to update a primary key!

2- Include All Columns in the WHERE clause
This way, first one to update the record wins! The second who had the same version of the record at the same time will fail to update.

3- Include Primary Key and Timestamp Columns
This way, only the first one wins the update, but in this case few checkings will be done in the WHERE clause, only the primary key(s) and a timestamp column.

4- Include the Primary Key Columns and Modified Columns
This is not recommended, because you as a developer should provide a different stored procedure for each updatable column.

Hope this helps!

Regards

Tags:

Dec 5 2006

Excentrics World Server Controls v2.0.4

Category:Bil@l @ 09:42

Excentrics World Server Controls v2.0.4

Was released on November 18 2006. I strongly recommend checking out this nice set of controls + their source code to use and learn from !!!

 

Regards

Tags:

Dec 5 2006

Susan Warren's XML Edit Grid

Category:Bil@l @ 09:02

An MVP Colleague, Ken Cox, posted a very nice tutorial on the XmlEditGrid Susan Warren created, which is a free control in C# including source code!!

Check out the tutorial here: http://authors.aspalliance.com/kenc/xmleditgrid.aspx

That is so cool Susan, good job!!

 

Regards

Tags:

Dec 2 2006

.NET Tips and Tricks

Category:Bil@l @ 10:18

I want to share with you a lovely site I passed through tonight, it is full of .NET tips and tricks!

Check it here: http://www.bluevisionsoftware.com/WebSite/TipsAndTricks.aspx

I am sure you will like it!

Regards

Tags:

Nov 28 2006

Most Popular Articles on ASPAlliance.com

Category:Bil@l @ 11:42

I was happy this morning to know that two of my articles:

  1. Extended GridView Control
  2. How to Popup a Window Using DIV Layer in ASP.NET 1.x/2.x

Are taking the 2nd and 3rd positions in the Most Popular Articles  on ASPAlliance.com!!

Thank you all for all this support you are giving me, by simply liking my articles and finding in them some benefit!

I promise to always do my best to deliver the best!

Regards

Tags: