Formattare le tabelle con i CSS cellspacing e cellpadding – nuove classe per bootstrap

In Html 5.0 gli attributi delle tabelle cellspacing e cellpadding non sono attributi validi e devono essere sostituti con l’utilizzo dei CSS.

  • cellpadding definisce il padding di una cella della tabella: la distanza tra il contenuto della cella e il suo perimetro.
  • cellspacing  definisce la distanza tra le celle di una tabella.  

cellpadding

per replicare l’effetto di cellpadding si deve impostare il padding delle celle quindi:

table td {
    padding: 2px;
}

poichè una tabella  può avere un header e un footer meglio includere anche questi elementi nella definizione di stile

table th, table td, table tf {
     padding: 2px;
 }

cellspacing

in css la proprietà border-collapse consente di replicare cellspacing due i valori possibili separate e collapse.

per eleminare le distanze tra le celle

table {     
      border-collapse: collapse;
 }

Per inserire una distanza in pixel usare il valore separate e impostare la proprietà border-spacing

table {
      border-collapse: separate;
      border-spacing: 5px;
 }

Bootstrap e le tabelle

Bootstrap per le tabelle definisce alcune classi che consentono una buona formattazione delle tabelle  stesse

  • table-responsive
  • table-condensed
  • table-bordered
  • table-striped

Considerato che bootstrap per condensed utilizza un padding di 5px è preferibile invece che cambiare  il valore di padding definire una nuova classe da posizionare in un foglio di style accessorio con un padding più contenuto anche di soli 0px.

.table-xcondensed > thead > tr > th,
.table-xcondensed > tbody > tr > th,
.table-xcondensed > tfoot > tr > th,
.table-xcondensed > thead > tr > td,
.table-xcondensed > tbody > tr > td,
.table-xcondensed > tfoot > tr > td {
    padding: 2px!important;
}

Con riferimento alle tabelle usando bottstrap può far comodo disporre anche di una classe table-bordless per  eliminare completamente i bordi di una tabella

table.table-borderless td, table.table-borderless th {
    border: none!important;
}

.table-borderless > tbody > tr > td,
.table-borderless > tbody > tr > th,
.table-borderless > tfoot > tr > td,
.table-borderless > tfoot > tr > th,
.table-borderless > thead > tr > td,
.table-borderless > thead > tr > th {
    border: none!important;
}

Risorse:

 

 

 

Annunci

asp.net RadioButtonList setting a default value

L’oggetto RadioButtonList

<asp:RadioButtonList ID="agree" Width="200px" RepeatDirection="horizontal" runat="server">
     <asp:ListItem Value="YES" Text="I agree" />
     <asp:ListItem Value="NO" Text="I do not agree" />
</asp:RadioButtonList>

come indicato nella figura sopra riportata non mostra un valore ( item) di  default selezionato.

Per selezionare un item di default si può utilizzare la proprietà Select impostandola a true

<asp:RadioButtonList ID="agree" Width="200px" RepeatDirection="horizontal" runat="server">
     <asp:ListItem Value="YES" Text="I agree" />
     <asp:ListItem Value="NO" Text="I do not agree" Select="true" />
</asp:RadioButtonList>

Oppure agire a livello di  back-end impostando la proprietà SelectedIndex. Il primo elemento ha valore 0 pertanto per seleziona la seconda voce ->

...
agree.SelectedIndex = 1;
...

Validazione dell’oggetto RadioButtonList

Per consenttire la sezione del solo valore (Value=) Yes corrispondente al  Text =” I agree” si può utilizzare nella proprietà ValidationExpression la regex =”^(?!NO)(.*)$”

ValidationExpression=”^(?!NO)(.*)$”

<asp:RadioButtonList ID="agree" Width="200px" RepeatDirection="horizontal" runat="server"&gt;
     <asp:ListItem Value="YES" Text="I agree" />
     <asp:ListItem Value="NO" Text="I do not agree" />
</asp:RadioButtonList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" CssClass="label label-warning" Display="Dynamic" runat="server" ErrorMessage="Privacy. Checked Yes to Continue" ControlToValidate="agree" />
<asp:RegularExpressionValidator Visible="true" Display="Static" Enabled="true" CssClass="label label-warning" ID="RegularExpressionValidator6" ControlToValidate="agree" ValidationExpression="^(?!NO)(.*)$"
EnableClientScript="True" ErrorMessage="Privacy: Check YES to Continue!" runat="server" />

 

Convertire nel backend il valore testuale dell’oggetto RadioButtonLIst  in valore bool

bool myagree = agree.SelectedItem.Value == "YES" ? true : false;

 

Asp.net C# Null Reference Exception of RadioButtonList value

Quando si utilizza un controllo RadioButtonList si può ottenere il valore selezionato utilizzando:

RadioButtonList1.SelectedItem.Value;

Se tuttavia nessun elemento della RadioButtonList viene selezionato SelectedItem.Value risulta nullo e si ottiente l’errore:

Null Reference Exception of RadioButtonList value

Per evitare l’eccezione è sufficiente controllare preventivamente che SelectedItem non sia null.
In forma compatta:

string _radiobuttonvalue = RadioButtonList1.SelectedItem != null ? RadioButtonList1.SelectedItem.Value : "";

in forma tradizionale

if  ( RadioButtonList1.SelectedItem != null )  {  
   string _radiobuttonvalue = RadioButtonList1.SelectedItem.Value ; }

 

 

 

Risorse:

AjaxControlToolkit rilasciata la versione 15.1 l’atteso ajax lato server per Asp.net

ASP.net Ajax  Rilasciata l’attesa nuova versione dell’ AJAX Control Toolkit l’utile Ajax lato server per Asp.Net. L’ultima rilascio del dicembre 2013 lasciava un po’ a desiderare tant’è che  si avvertiva la necessità di un aggiornamento. Con la nuova versione la v15.1 c’è stato un significativo lavoro di revisione e miglioramento che evidenzia al primo impatto maggiore velocità e stabilità dei componenti.   Le novità della nuova versione che ha come nuovo mantainer DevExpress: What’s new.

Con la nuova versione termina il supporto alle versioni di Asp.Net precedenti la 4.0.

Unica nota dolente è disponibile, al momento,  solo la versione installabile che necessita della presenza di Visual Studio. Va considerato che ora  è disponibile una versione free di Visual Studio: la versione community.

Comunque una volta installata la versione del Control Toolkit, e creata la prima web application per aggiornare altre web application che fanno uso dell’Ajax  Control ToolKit sarà sufficiente :

  • prelevare i binari dalla cartella /bin e copiarli nella web application da aggiornare sostituendo quindi i files della precedente versione
  • apportare le modifiche base per l’utilizzo della nuova versione in particolare la sostituzione del controllo  <ajaxToolkit:ToolkitScriptManager …  con <asp:ScriptManager  ….
    Esemplificando

    <ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" />

    ora va sostituito con

    <asp:ScriptManager ID="ScriptManager2" runat="server" />


  • Eliminare se presenti dal web.config i riferimenti alla precedente versione del Control ToolKit
    come indicato in   Upgrade your project to AjaxControlToolkit v15.1 .
    Di fatto in web.config è sufficiente dichiarare il namespace AjaxControlToolkit

    <system.web>
    ......
       <pages>
           <controls>     
    ......
             <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
           </controls>
       </pages>
    </system.web>

 

Risorse:

 

asp.net tabs ajax toolkits TabContainer evitare lo scroll della pagina

In Asp.net quando si utilizzo l’oggetto tabcontainers dell’ajax toolkits per generare tabulatori lato server, si assiste alla fastidiosa, a mio modo di vedere, conseguenza che la pagina una volta caricata si scrolla posizionandosi proprio a livello dei tabulatori presente nella pagina.

Per ovviare alla  scroll down provocato dall’oggetto tabcontainer si può inserire il seguente scripts nella pagina o control user asp.net.



        Sys.Extended.UI.TabContainer.prototype._app_onload = function (sender, e) {
            if (this._cachedActiveTabIndex != -1) {
                this.set_activeTabIndex(this._cachedActiveTabIndex);
                this._cachedActiveTabIndex = -1;

                var activeTab = this.get_tabs()[this._activeTabIndex];
                if (activeTab) {
                    activeTab._wasLoaded = true;
                    //activeTab._setFocus(activeTab);     // the only change made to this prototype
                }
            }
            this._loaded = true;
        }



 

IIS 8.0 There is a duplicate ‘system.web.extensions/scripting/scriptResourceHandler’ section defined

Trasferendo una web application ASP.NET da Windows 2008 server con IIS 7.5  a Windows Server 2012 con  IIS 8.0 può capitare di riscontrare il seguente messaggio di errore

There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' 
section defined

Due soluzioni possibili:

1) L’applicazione è assegnata ad un’ Application Pools non appropriato:
I progetti sviluppati con i frameworks dalla versione  2.0 alla verione 3.5 vanno assegnati ad un Application Pools con .NET FRAMEWORK VERSION v2.0.xxxx

I progetti sviluppati con in 4.0 e seguenti vanno assegnati ad un Application pools con .NET FRAMEWORK VERSION v4.0.xxxxx

Application Pools in Windows 2012 server con IIS 8.0

Application Pools
Applications Pools

2) Disabilitare commentando con <!–   –> le righe della sezione <sectionGroup name=”system.web.extensions”…> per le quali viene presentato il messaggio. Valutare adirittura di estendere il commento a tutta la sezione system.web.extension presente all’inizio ovviamente del file di configurazione web.config.

Esempio di commento

<!–section name=”scriptResourceHandler” type=”System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ requirePermission=”false” allowDefinition=”MachineToApplication” /–>

Una volta commentate le righe ho sperimentato il funzionamento di applicazioni ASP.NET versione 3.5 anche una volta associate ad Application Pools 4.0

...
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
   <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
      <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
         <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
         <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
         <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
         <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
      </sectionGroup>
    </sectionGroup>
</sectionGroup>
...

Risorse:

AjaxControlToolkit.ToolkitScriptManager.CombineScriptsHandlerUrl’ is obsolete: ‘Please register AjaxControlToolkit.CombineScriptsHandler http handler instead.

When you use AjaxControlToolkit.ToolkitScriptManager and building/validating an asp.net application is showed the error message

AjaxControlToolkit.ToolkitScriptManager.CombineScriptsHandlerUrl’ is obsolete: ‘Please register AjaxControlToolkit.CombineScriptsHandler http handler instead.

and in the page is present this

<ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" 
  runat="server" CombineScriptsHandlerUrl="~/CombineScriptsHandler.ashx" />

you can fix by removing the attribute  CombineScriptsHandlerUrl=”~/CombineScriptsHandler.ashx” .

thus became

<ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server"  />

Risorse:

Asp.net web.config differenze tra versione 3.5 e 4.5

Di seguito le modifiche ad un file web.config di asp.net versione 3.5 affinchè risulti compatibile con la versione 4.5 del framework di asp.net. In generale la versione 4.5 di asp.net è più snella molte dichiarazioni non sono più necessarie.

Nel primo file compatibile con il framework asp.net 3.5 sono evidenziate:

  • in rosso sezioni/righe  tipiche del framework 3.5 che vengono eliminate nel 4.5
  • in blue quelle modificate
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <configSections>
     <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
 <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
  </configSections>
 <!-- application specific settings -->
 <appSettings>
    <add key="Server" value="192.168.1.157"/>
    <add key="DownloadareaMainPhysicalPath" value="G:\www\downloadarea" />
    ....      
 </appSettings>
 <system.webServer>
   <security>
     <requestFiltering allowDoubleEscaping="true" />
   </security>
     <modules>
        <remove name="ScriptModule" />
        <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
     </modules>
     <handlers>
         <remove name="WebServiceHandlerFactory-Integrated" />
         <remove name="ScriptHandlerFactory" />
         <remove name="ScriptHandlerFactoryAppServices" />
         <remove name="ScriptResource" />
        <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
 </handlers>
 </system.webServer>
 <system.web>
   <!-- globalization culture -->
   <globalization culture="it-IT" uiCulture="it-IT" requestEncoding="iso-8859-1" responseEncoding="iso-8859-1" />

 <sessionState timeout="15" />
 <!--
     Set compilation debug="true" to insert debugging
     symbols into the compiled page. Because this
     affects performance, set this value to true only
     during development.
 -->
 <compilation debug="true" defaultLanguage="c#">
    <assemblies>
       <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
       <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
       <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
       <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    </assemblies>
  </compilation>
  <httpHandlers>
     <remove verb="*" path="*.asmx" />
     <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
     <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
     <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
  </httpHandlers>
  <httpModules>
         <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </httpModules>
 <!-- Portal supports either Forms authentication (Internet)
 or Windows authentication (for intranets). Forms Authentication is
 the default. To change to Windows authentication, comment the
 <authentication mode="Forms"> section below, and uncomment the
 <authentication mode="Windows"> section. -->
 <authentication mode="Forms">
    <!-- default timeout value 30 min (the timeout value is in minutes)-->
    <forms name=".ASPXFORMSAUTH" protection="All" timeout="60" />
    <!--forms name=".ASPXAUTH" protection="All" timeout="60" /-->
 </authentication>
 <!--<authentication mode="Windows" />
    <authorization>
    <deny users="?" />
 </authorization>-->

 <httpRuntime executionTimeout="500" maxRequestLength="10000" useFullyQualifiedRedirectUrl="true" />
 <urlMappings>
    <add url="~/AccessDenied.aspx" mappedUrl="~/portal.aspx?pg=access denied" />
    .... 
 </urlMappings>
 <customErrors mode="RemoteOnly">
     <error statusCode="405" redirect="~/portal.aspx?pg=HTTP 405" />
     <error statusCode="505" redirect="~/portal.aspx?pg=HTTP 505" />
     ...
 </customErrors>
 <pages validateRequest="false" enableViewStateMac="false" viewStateEncryptionMode="Auto">
    <namespaces>
       <add namespace="System.Globalization" />
       <add namespace="ASPNetPortal" />
       <add namespace="ASPNetPortal.Web.UI" />
    </namespaces>
    <controls>
       <add tagPrefix="ap" namespace="ASPNetPortal.Web.UI.WebControls" />
             <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
       <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit" />
            <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </controls>
 </pages>
 <!-- Adapter configuration for mobile controls used in the portal -->
 <mobileControls>
   <device name="PortalHtmlDeviceAdapters" inheritsFrom="HtmlDeviceAdapters">
      <control name="ASPNetPortal.MobileControls.TabbedPanel, Portal" adapter="ASPNetPortal.MobileControls.HtmlTabbedPanelAdapter,Portal" />
      <control name="ASPNetPortal.MobileControls.LinkCommand, Portal" adapter="ASPNetPortal.MobileControls.HtmlLinkCommandAdapter,Portal" />
   </device>
   <device name="PortalChtmlDeviceAdapters" inheritsFrom="ChtmlDeviceAdapters">
     <control name="ASPNetPortal.MobileControls.TabbedPanel, Portal" adapter="ASPNetPortal.MobileControls.ChtmlTabbedPanelAdapter,Portal" />
   </device>
   <device name="PortalWmlDeviceAdapters" inheritsFrom="WmlDeviceAdapters">
      <control name="ASPNetPortal.MobileControls.TabbedPanel, Portal" adapter="ASPNetPortal.MobileControls.WmlTabbedPanelAdapter,Portal" />
   </device>
 </mobileControls>
 <!-- Mobile device filters used for customizing portal -->
 <deviceFilters>
    <filter name="isJScript" compare="javascript" argument="true" />
    <filter name="isPocketIE" compare="browser" argument="Pocket IE" />
    <filter name="isHTML32" compare="preferredRenderingType" argument="html32" />
 </deviceFilters>
 </system.web>

 <location path="Admin">
   <system.web>
      <pages theme="ThAdmin" masterPageFile="~/TemplateAdmin.master" maintainScrollPositionOnPostBack="true"></pages>
   </system.web>
 </location>
 <location path="DesktopModules/EditMenu.aspx">
    <system.web>
       <pages theme="ThAdmin" masterPageFile="~/TemplateAdmin.master" maintainScrollPositionOnPostBack="true"></pages>
    </system.web>
 </location>
 ...
  
 <system.webServer>
 <directoryBrowse enabled="false" />
 <validation validateIntegratedModeConfiguration="false" />
 </system.webServer>
 <system.codedom>
   <compilers>
     <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
          <providerOption name="CompilerVersion" value="v3.5" />
          <providerOption name="WarnAsError" value="false" />
     </compiler>
     <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
          <providerOption name="CompilerVersion" value="v3.5" />
          <providerOption name="OptionInfer" value="true" />
          <providerOption name="WarnAsError" value="false" />
      </compiler>
   </compilers>
 </system.codedom>
 <runtime>
   <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v2.0.50727">
     <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
     </dependentAssembly>
     <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
     </dependentAssembly>
   </assemblyBinding>
 </runtime>
</configuration>


La versione 4.5 dello stesso web.config  decisamente più snella

<?xml version="1.0"?>
<configuration>

 <!-- application specific settings -->
 <appSettings>
    <add key="Server" value="192.168.1.157"/>
    <add key="DownloadareaMainPhysicalPath" value="G:\www\downloadarea" />
    ....      
 </appSettings>
 <system.webServer>
   <security>
     <requestFiltering allowDoubleEscaping="true" />
   </security>
 </system.webServer>
 <system.web>
   <!-- globalization culture -->
   <globalization culture="it-IT" uiCulture="it-IT" requestEncoding="iso-8859-1" responseEncoding="iso-8859-1" />

 <sessionState timeout="15" />
 <!--
     Set compilation debug="true" to insert debugging
     symbols into the compiled page. Because this
     affects performance, set this value to true only
     during development.
 -->
  <compilation debug="true" defaultLanguage="c#" targetFramework="4.5"/>
 <!-- Portal supports either Forms authentication (Internet)
 or Windows authentication (for intranets). Forms Authentication is
 the default. To change to Windows authentication, comment the
 <authentication mode="Forms"> section below, and uncomment the
 <authentication mode="Windows"> section. -->
 <authentication mode="Forms">
    <!-- default timeout value 30 min (the timeout value is in minutes)-->
    <forms name=".ASPXFORMSAUTH" protection="All" timeout="60" />
    <!--forms name=".ASPXAUTH" protection="All" timeout="60" /-->
 </authentication>
 <!--<authentication mode="Windows" />
    <authorization>
    <deny users="?" />
 </authorization>-->

 <httpRuntime executionTimeout="500" maxRequestLength="10000" useFullyQualifiedRedirectUrl="true" />
 <urlMappings>
    <add url="~/AccessDenied.aspx" mappedUrl="~/portal.aspx?pg=access denied" />
    .... 
 </urlMappings>
 <customErrors mode="RemoteOnly">
     <error statusCode="405" redirect="~/portal.aspx?pg=HTTP 405" />
     ...
 </customErrors>
 <pages validateRequest="false" enableViewStateMac="false" viewStateEncryptionMode="Auto" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
     <namespaces>
       <add namespace="System.Globalization" />
       <add namespace="ASPNetPortal" />
       <add namespace="ASPNetPortal.Web.UI" />
    </namespaces>
    <controls>
       <add tagPrefix="ap" namespace="ASPNetPortal.Web.UI.WebControls" />
       <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit" />
    </controls>
 </pages>
 <!-- Adapter configuration for mobile controls used in the portal -->
 <mobileControls>
   <device name="PortalHtmlDeviceAdapters" inheritsFrom="HtmlDeviceAdapters">
      <control name="ASPNetPortal.MobileControls.TabbedPanel, Portal" adapter="ASPNetPortal.MobileControls.HtmlTabbedPanelAdapter,Portal" />
      <control name="ASPNetPortal.MobileControls.LinkCommand, Portal" adapter="ASPNetPortal.MobileControls.HtmlLinkCommandAdapter,Portal" />
   </device>
   <device name="PortalChtmlDeviceAdapters" inheritsFrom="ChtmlDeviceAdapters">
     <control name="ASPNetPortal.MobileControls.TabbedPanel, Portal" adapter="ASPNetPortal.MobileControls.ChtmlTabbedPanelAdapter,Portal" />
   </device>
   <device name="PortalWmlDeviceAdapters" inheritsFrom="WmlDeviceAdapters">
      <control name="ASPNetPortal.MobileControls.TabbedPanel, Portal" adapter="ASPNetPortal.MobileControls.WmlTabbedPanelAdapter,Portal" />
   </device>
 </mobileControls>
 <!-- Mobile device filters used for customizing portal -->
 <deviceFilters>
    <filter name="isJScript" compare="javascript" argument="true" />
    <filter name="isPocketIE" compare="browser" argument="Pocket IE" />
    <filter name="isHTML32" compare="preferredRenderingType" argument="html32" />
 </deviceFilters>
 </system.web>

 <location path="Admin">
   <system.web>
      <pages theme="ThAdmin" masterPageFile="~/TemplateAdmin.master" maintainScrollPositionOnPostBack="true"></pages>
   </system.web>
 </location>
 <location path="DesktopModules/EditMenu.aspx">
    <system.web>
       <pages theme="ThAdmin" masterPageFile="~/TemplateAdmin.master" maintainScrollPositionOnPostBack="true"></pages>
    </system.web>
 </location>
 ...
  
 <system.webServer>
 <directoryBrowse enabled="false" />
 <validation validateIntegratedModeConfiguration="false" />
 </system.webServer>
</configuration>


L