martedì 19 gennaio 2010

mercoledì 9 aprile 2008

If you don't use session state, you can improve performance of your web application by disabling session state.

If you want to disable the sessions for the whole application, you need to set the web.config in the following way:

  <configuration>
      <system.web>
      <sessionState
mode="Off" />

If you want you can disable the sessions state in a specific page:

<%@ Page Language="C#" AutoEventWireup="true" EnableSessionState="False" %>
Tags:
 

We have a Patterns Panacea effect when we forget the first rule of XP methodology: simplicity  and we want to use a pattern in any case.

We need to relax our mind and choose the easiest way, it will be the better way.

If in the future we need to change it in order to remove some duplicates or some overload we will refactor it.

 

The Under-Engineering is far more common than Over-Engineering.

When we produce poorly designed software we under-engineer.

The big problem of under-engineering is maintaining the software we have producted.

Under-engineering may occur for several reasons:

  • We don't have time or have not enough time to refactor
  • We aren't knowledgeable about good software design
  • We're expected to quickly add new features to existing system
  • We're made to work on too many projects at once.

domenica 6 aprile 2008

I was reading the book of Martin Fowler: Refactoring to Patterns.

Just on the first five pages of this book there are so many information to think about.

One of these is the Over-engineering terminology.

The Over-engineering word means:

When you make your code more flexible or sophisticated than it needs to be, you Over-Engineer it.

Some programmers do this because they believe they know their system's future requirements.

If your predictions are wrong, you waste precious time and money.

What typically happens with code you produce in anticipation of needs that never materialize?

It never gets removed.

martedì 1 aprile 2008

To increment the security of the ASP.NET ViewState data you must enable the encryption of the data.

To do that, you can choose between two option:

1 - By the web.config file:
  <configuration>
      <system.web>
      <pages
viewStateEncryptionMode="Always" />

Through this option you will enable the encryption of the ViewState data for all the application pages.

2 -  By the page:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" ViewStateEncryptionMode="Always" %>

Make attention on the ViewStateEncryptionMode.

In this case you enable the encryption only for the page ViewState data.

lunedì 31 marzo 2008

At the following link: http://www.visifire.com/silverlight_charts_gallery.php

You can find a lot of Siliverlight's example charts.

mercoledì 26 marzo 2008

New asp.net security videos from asp.net (security) (tnx Scott Mitchell).

Two new videos from Lamees Ayman:

Thanks Lamees Ayman.

martedì 18 marzo 2008

Another helpful link for your WCF errors :D

http://blogs.msdn.com/amitlale/archive/2007/01/29/addressaccessdeniedexception-cause-and-solution.aspx

Tags:
 

Hi guys,
I had a problem with the TreeView.

I needed to change the text in bold of the clicked TreeView's leaves, without using Themes.

I found a workaround as follows:

        protected void Page_Init(object sender, EventArgs e)
        {
            string selectedLeaf = string.Empty;
            if (Request.QueryString.Get("Report") != null)
                selectedLeaf = Request.QueryString.Get("Report");

            foreach (TreeNode tn in trvMenuControlli.Nodes[0].ChildNodes)
            {
                if (tn.NavigateUrl.Substring(tn.NavigateUrl.LastIndexOf("=") + 1) == selectedLeaf)
                {
                    tn.Text = "<b>" + tn.Text + "</b>";
                    break;
                }
            }
        }

The leaves are static specified on the aspx page.

Enjoy.

Tags:

lunedì 17 marzo 2008

Sometimes IIS 7 drive me crazy :D

If you receive an 404.3 error by yours wcf application look the following link:

http://blogs.msdn.com/davidwaddleton/archive/2007/11/02/wcf-and-404-3-errors.aspx

Tags: ,

domenica 16 marzo 2008

Mix has finished in Mar 11th but you can still watch the session at: http://sessions.visitmix.com/

giovedì 13 marzo 2008

I'm a fan of xp methodology, and I am studying and using it a little at a time.
 
One of the questions I do to myself in these days is:

  • What is the difference between SCRUM and XP?


I have found some answers in Martin's article:
http://martinfowler.com/articles/newMethodology.html


How Martin wrote the big difference are:

  • Scrum concentrates on the management aspects of software development
  • Scrum dividing development into thirty day iterations (called
    'sprints') and applying closer monitoring and control with daily scrum
    meetings
  • Scrum places much less emphasis on engineering practices

I still prefer XP because I like the TDD approach.
What do you think about?

Tags:

venerdì 29 febbraio 2008

Today I have read about this cool plug-in for Visual Studio 05.

It detect whole the XSS problem in your asp.net web application.

You can download it here.

Tags: ,

domenica 24 febbraio 2008

In this last week I have developed an application that uses ASP.NET and some AJAX Toolkit Control ver. 1.0.11119.0.

I noticed that when the CalendarExtender was inside an UpdatePanel it lost the css style information.

To avoid this problem I found this thread where you can read that you need to specify the css style in your page or in your css file, in this way:

.ajax__calendar_container {padding:4px;position:absolute;cursor:default;width:170px;font-size:11px;text-align:center;font-family:tahoma,verdana,helvetica;}
.ajax__calendar_body {height:139px;width:170px;position:relative;overflow:hidden;margin:auto;}
.ajax__calendar_days, .ajax__calendar_months, .ajax__calendar_years {top:0px;left:0px;height:139px;width:170px;position:absolute;text-align:center;margin:auto;}
.ajax__calendar_container TABLE {font-size:11px;}
.ajax__calendar_header {height:20px;width:100%;}
.ajax__calendar_prev {cursor:pointer;width:15px;height:15px;float:left;background-repeat:no-repeat;background-position:50% 50%;
background-image:url(WebResource.axd?d=x6lt9HfG5Si8NZjMNt1DLcY6US8hUl3G4muzIFtahMQFZTbwxJ00qsx5N8jeAW90ZvGxZ6SJJh48yx62JKItzQ2&t=633053122925312500);}
.ajax__calendar_next {cursor:pointer;width:15px;height:15px;float:right;background-repeat:no-repeat;background-position:50% 50%;
background-image:url(WebResource.axd?d=x6lt9HfG5Si8NZjMNt1DLcY6US8hUl3G4muzIFtahMQFZTbwxJ00qsx5N8jeAW90HZemRms4wXOo1BZWTwWtNQ2&t=633053122925312500);}
.ajax__calendar_title {cursor:pointer;font-weight:bold;}
.ajax__calendar_footer {height:15px;}
.ajax__calendar_today {cursor:pointer;padding-top:3px;}
.ajax__calendar_dayname {height:17px;width:17px;text-align:right;padding:0 2px;}
.ajax__calendar_day {height:17px;width:18px;text-align:right;padding:0 2px;cursor:pointer;}
.ajax__calendar_month {height:44px;width:40px;text-align:center;cursor:pointer;overflow:hidden;}
.ajax__calendar_year {height:44px;width:40px;text-align:center;cursor:pointer;overflow:hidden;}

.ajax__calendar .ajax__calendar_container {border:1px solid #646464;background-color:#ffffff;color:#000000;}
.ajax__calendar .ajax__calendar_footer {border-top:1px solid #f5f5f5;}
.ajax__calendar .ajax__calendar_dayname {border-bottom:1px solid #f5f5f5;}
.ajax__calendar .ajax__calendar_day {border:1px solid #ffffff;}
.ajax__calendar .ajax__calendar_month {border:1px solid #ffffff;}
.ajax__calendar .ajax__calendar_year {border:1px solid #ffffff;}

.ajax__calendar .ajax__calendar_active .ajax__calendar_day {background-color:#edf9ff;border-color:#0066cc;color:#0066cc;}
.ajax__calendar .ajax__calendar_active .ajax__calendar_month {background-color:#edf9ff;border-color:#0066cc;color:#0066cc;}
.ajax__calendar .ajax__calendar_active .ajax__calendar_year {background-color:#edf9ff;border-color:#0066cc;color:#0066cc;}

.ajax__calendar .ajax__calendar_other .ajax__calendar_day {background-color:#ffffff;border-color:#ffffff;color:#646464;}
.ajax__calendar .ajax__calendar_other .ajax__calendar_year {background-color:#ffffff;border-color:#ffffff;color:#646464;}

.ajax__calendar .ajax__calendar_hover .ajax__calendar_day {background-color:#edf9ff;border-color:#daf2fc;color:#0066cc;}
.ajax__calendar .ajax__calendar_hover .ajax__calendar_month {background-color:#edf9ff;border-color:#daf2fc;color:#0066cc;}
.ajax__calendar .ajax__calendar_hover .ajax__calendar_year {background-color:#edf9ff;border-color:#daf2fc;color:#0066cc;}

.ajax__calendar .ajax__calendar_hover .ajax__calendar_title {color:#0066cc;}
.ajax__calendar .ajax__calendar_hover .ajax__calendar_today {color:#0066cc;}

 

mercoledì 20 febbraio 2008

Why you write comments in your source code?

Comments lead the developer to wrote bad code.

If you wrote a good source code, it will be readable without comments.
For example, if you wrote a method called:

DrawContent.AfterDivisionBy2(4);

I think you don't need to comment with a line of code like that.

So, when is useful wrote comments?

Comments are useful when you are working with a old bad code where you (or your manager) want make a lot of refactoring.

Anyway I suggest to you to review the code before comment it.