Thursday, February 24, 2011

Align a div center of page vertically and horizontally

Today i need to align a div center in page horizontal as well as verticle.


css :
body
{
font-size: 14px;
font-family: verdana, helvetica, sans-serif;
color: #333;
}
p
{
margin: 2em;
}

#centerdiv
{
position: absolute;
top: 50%;
left: 50%;
width: 50em;
height: 26em;
margin-top: -13em; /*set to a negative number 1/2 of your height*/
margin-left: -25em; /*set to a negative number 1/2 of your width*/
border: 1px solid #ccc;
background-color: #f3f3f3;
}


html is :

Wednesday, February 23, 2011

List of Simple Quality Checks while developing a software or web site

15 Basic QC points to check while developing the software / web application.

In today’s world software development is very rapid process. There are very tight deadlines which need to meet by developers. Usually developers finish the development but after it delivered to QC team developer get a big list of bugs find by qc team. And then developer needs to solve bug list overnight which is very tedious job. Herewith I tried to list out common qc points which developer can check at the time of development which make his/her life easier. Hope it will helpful to developers.

  1. Proper tab index of every field in all the pages.
  2. There should be * near mandatory field. And a note in bottom of page which mention that * fields are mandatory / compulsory.
  3. Set the max length property of every input field in a page so that user can’t enter longer text in field.
  4. There should be at least one default button (i.e. Save / Submit etc.)
  5. In windows application every entry form should be close when user press escape key.
  6. There should be product icon on top left corner or every page in case of windows application.
  7. Numeric fields should not accept alpha characters.
  8. Use proper validation for email addresses, phone numbers etc.
  9. During development please check the junk character entry like ', @, #, $ etc. it should be pass on insert, update, record fetching etc.
  10. In case of listing – details page scenario listing page should have features like sorting, paging, search by all required columns, go to page etc.
  11. Every master entry should be entered during transaction form (i.e. if your transaction form has combo box which contain master data then there should be a + button near combo box, user should be able to press this button and that button should open particular master page after inserting new master entry it should be selected in given combo box.)
  12. Use of try .. catch block. Developer should use try catch block on every event handler where user can interact. Also user should not get unhandled exception, there should be proper message to user in case of any exception and that error should be logged in some text file on user’s machine / server in case of web based application.
  13. Use proper validation for avoiding duplicate master entries.
  14. Referential integrity should be maintain, means when user tries to delete any master entry system should check for the existence of referential data in transactions and should give proper message to user. Then take action like deactivate the master or remove all referential transactions whatever best suits as per the requirements of software.
  15. Every field should have a tooltip which can help user to understand the role of that field in the page.

validation of viewstate mac failed in asp.net

Before some days the error "Validation of viewstate MAC failed" became my great enemy.
I done lot's of googling to resolve the problem.
I found some good links in which they show some ways to prevent this error one of them is
http://blogs.msdn.com/b/tom/archive/2008/03/14/validation-of-viewstate-mac-failed-error.aspx
Hard luck with me, i tried tips shown in above link which did not work for me, finally after lots of efforts i found the root cause for that error. My all websites were hosted on shared server and they did not alocated dedicated application pool, so most of web sites were on default application pool and hosting people has done setting which recycles that pool every 5 minutes. so when the page got post back after interval of more than 5 minutes application pool get recycled and server raise above error
Validation of viewstate MAC failed.

So finally we decided to buy a dedicated server for our websites and i set dedicated application pool for each website with proper settings so that it does not recycled every 5 minutes.

Finally i got the solution for above error and now me and our clients are happy.


Resources : Asp.net, c#, mysql, iis6.0