<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10spanishfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;Ck8DQ3gyfCp7ImA9WxNUF0U.&quot;"><id>tag:blogger.com,1999:blog-27752126</id><updated>2009-11-09T16:34:32.694+01:00</updated><title>Variable not found</title><subtitle type="html">Artículos, noticias, curiosidades, reflexiones... sobre el mundo del desarrollo de software, internet, u otros temas relacionados con la tecnología.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.variablenotfound.com/" /><link rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>272</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><link rel="self" href="http://feeds.feedburner.com/vnf" type="application/atom+xml" /><feedburner:emailServiceId>vnf</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fvnf" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/vnf" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fvnf" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fvnf" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fvnf" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://add.my.yahoo.com/content?lg=es&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2Fvnf" src="http://eur.i1.yimg.com/eur.yimg.com/i/es/my/addto1.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.feedness.com/alta/http://feeds.feedburner.com/vnf" src="http://www.feedness.com/ayuda/wp-content/square_b_sh_feed.gif">Subscribe with Feedness</feedburner:feedFlare><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry gd:etag="W/&quot;CEUARnw_eyp7ImA9WxNUF0s.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-4359770668533141842</id><published>2009-11-09T00:12:00.002+01:00</published><updated>2009-11-09T11:24:07.243+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-09T11:24:07.243+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="buenas prácticas" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><category scheme="http://www.blogger.com/atom/ns#" term="aspnetmvc" /><title>12 buenas prácticas en ASP.NET MVC</title><content type="html">&lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px 5px; display: inline; border-top: 0px; border-right: 0px" title="ASP.NET MVC" border="0" alt="image" align="right" src="http://lh3.ggpht.com/_O9D62hXq-ng/SuhvR8CjCjI/AAAAAAAABI4/yjorBrcLFbc/image%5B3%5D.png?imgmax=800" width="179" height="95" /&gt;Simone Chiaretta, desarrollador, MVP, bloguero y autor de un &lt;a href="http://www.amazon.com/gp/product/047043399X?ie=UTF8&amp;tag=variabnotfoun-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=047043399X" title="Beginning ASP.NET MVC 1.0 en Amazon"&gt;libro sobre ASP.NET MVC Framework&lt;/a&gt;, entre otros méritos, recoge en su recomendable bitácora &lt;a title="Code Climber" href="http://codeclimber.net.nz/" hreflang="en" target="_blank"&gt;Code Climber&lt;/a&gt; unas cuantas &lt;a title="12 ASP.NET MVC best practices" href="http://codeclimber.net.nz/archive/2009/10/27/12-asp.net-mvc-best-practices.aspx" target="_blank"&gt;buenas prácticas&lt;/a&gt; a considerar cuando trabajamos en proyectos &lt;a title="13 preguntas básicas sobre ASP.NET MVC" href="http://www.variablenotfound.com/2009/04/aspnet-mvc-trece-preguntas-basicas.html" target="_blank"&gt;ASP.NET MVC&lt;/a&gt;, que cito y comento a continuación:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;strong&gt;Borra el AccountController. &lt;/strong&gt;Siendo fieles al principio &lt;a title="¡No vas a necesitarlo!" href="http://es.wikipedia.org/wiki/No_vas_a_necesitarlo_(YAGNI)" target="_blank"&gt;YAGNI&lt;/a&gt;, prácticamente lo primero que deberíamos hacer al crear un proyecto ASP.NET MVC es eliminar todo lo relativo al sistema de cuentas de usuario incluido por defecto en el mismo, que muy difícilmente nos será útil tal cual en proyectos reales.      &lt;p /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Aísla los controladores del mundo exterior&lt;/strong&gt;, no dejes que dependan de elementos externos como &lt;code&gt;HttpContext&lt;/code&gt;,&amp;#160; datos del reloj (hora/fecha actual), ni accedas directamente a bases de datos o elementos de configuración. Harán tu aplicación muy poco flexible y difícil de testear.      &lt;p /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Utiliza un contenedor IoC&lt;/strong&gt;, te ayudará a gestionar las dependencias de los controladores, facilitando la sustitución de estos elementos de forma muy sencilla, sobre todo, vistas a la realización de pruebas.      &lt;p /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;No utilices cadenas mágicas&lt;/strong&gt;, dificultan la detección de errores. No es buena idea usar expresiones del tipo &lt;code&gt;ViewData[&amp;quot;variable&amp;quot;]&lt;/code&gt;, las vistas tipadas son el mecanismo ideal para pasar información desde el controlador. También es peligroso el uso de los helpers que utilizan cadenas para referirse a nombres de controladores y acciones, y para ello existen alternativas basadas en expresiones lambda o &lt;a title="T4 MVC" href="http://blogs.msdn.com/davidebb/archive/2009/10/15/t4mvc-2-4-04-update-mvc-2-support-new-settings-cleanup-fixes.aspx" hreflang="en" target="_blank"&gt;plantillas T4&lt;/a&gt; bastante potentes.      &lt;p /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Crea tus propias convenciones&lt;/strong&gt; tomando como base las propuestas por el framework MVC. Por ejemplo, crea controladores y vistas base de las que heredar, e implementa en ellos aspectos comunes.      &lt;p /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Presta atención a los Verbos&lt;/strong&gt;, a los verbos HTTP, claro ;-). Envía información desde formularios con el método POST y genera las vistas que muestran datos desde peticiones GET. Utiliza el patrón &lt;a title="El patrón Post-Redirect-Get" href="http://www.variablenotfound.com/2009/11/el-patron-post-redirect-get.html"&gt;Post-Redirect-Get&lt;/a&gt;.&lt;p /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;DomainModel != ViewModel,&lt;/strong&gt; el primero representa los datos y lógica del dominio, mientras que el segundo se diseña exclusivamente para satisfacer las necesidades de información de las vistas y normalmente serán estructuras planas, y principalmente strings, que es el tipo de datos que normalmente necesitan los controles de entrada y salida de datos.      &lt;p /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Usa ActionFilters para manejar los datos compartidos&lt;/strong&gt; entre distintas acciones y controladores, dejando que éstos se centren en la tarea que deben realizar. Puedes utilizar filtros para cargar información común (por ejemplo, para componentes de una página maestra) y utilizar vistas parciales para mostrarla.      &lt;p /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;No utilices el code-behind&lt;/strong&gt;. Nunca. En mi opinión, el code-behind no es necesario (al menos no le he encontrado aún ninguna utilidad en MVC), y puede crear confusión si compartes tu código con otros desarrolladores que no esperarán encontrar nada ahí.      &lt;p /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Escribe HTML siempre que puedas.&lt;/strong&gt; No utilices helpers que lo único que van a hacer es generar el código HTML por ti. Es decir, mejor usar &lt;code&gt;&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;grabar&amp;quot; /&amp;gt;&lt;/code&gt; que &lt;code&gt;&amp;lt;%=Html.Submit(&amp;quot;grabar&amp;quot;) %&amp;gt;.       &lt;p /&gt;&lt;/code&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Si hay un if, escribe un helper&lt;/strong&gt;. Las vistas deben ser fáciles de leer, y muchos bloques de códigos mezclados con marcado no facilita la tarea. Dado que en las vistas la lógica ha de ser necesariamente muy simple, probablemente puedas crear helpers que simplifiquen la composición del marcado en casos en los que hay condiciones &lt;code&gt;if&lt;/code&gt; o bucles &lt;code&gt;for&lt;/code&gt; .      &lt;p /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Elige el motor de vistas cuidadosamente&lt;/strong&gt;, WebFormViewEngine no es el único ni, para Simone, el mejor de los existentes. De hecho, recomienda el uso de &lt;a title="Spark View Engine" href="http://sparkviewengine.com/" hreflang="en" target="_blank"&gt;Spark&lt;/a&gt;, un motor de vistas libre en el que es el propio HTML el que controla el flujo de composición del interfaz de forma muy sencilla y potente:      &lt;p /&gt;&lt;/li&gt;    &lt;div id="page"&gt;     &lt;div id="section1" class="clear-block clr"&gt;       &lt;div class="sections"&gt;         &lt;div class="section width49"&gt;           &lt;div id="block-block-3" class="block block-block unstyled-block"&gt;             &lt;div class="content"&gt;               &lt;div id="codeSnippetWrapper"&gt;                 &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;                   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;viewdata&lt;/span&gt; &lt;span style="color: #ff0000"&gt;products&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;IEnumerable[[Product]]&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;                  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ul&lt;/span&gt; &lt;span style="color: #ff0000"&gt;if&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;products.Any()&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;                  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt; &lt;span style="color: #ff0000"&gt;each&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;var p in products&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;${p.Name}&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;                  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ul&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;                  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;else&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;                  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;p&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;No products available&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;p&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;                  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;else&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;              &lt;/div&gt;              &lt;div&gt;&amp;#160;&lt;/div&gt;              &lt;div&gt;En mi caso, todavía no he encontrado motivos suficientes como para dar el salto a un motor de vistas distinto de WebForms. Sinceramente, no me parece tan aberrante ver código y marcado dentro del mismo archivo, siempre teniendo en cuenta que la lógica que debe aparecer en estos puntos debe ser siempre relativa a la presentación y, por tanto, simplísima.&lt;/div&gt;            &lt;/div&gt;          &lt;/div&gt;        &lt;/div&gt;      &lt;/div&gt;    &lt;/div&gt;  &lt;/div&gt;&lt;/ol&gt;&lt;p&gt;Opiniones aparte, la verdad es que es un interesante grupo de consejos a tener en cuenta.&lt;/p&gt;&lt;p&gt;Fuente: &lt;a title="12 ASP.NET MVC Best Practices" href="http://codeclimber.net.nz/archive/2009/10/27/12-asp.net-mvc-best-practices.aspx" target="_blank"&gt;12 ASP.NET MVC Best Practices&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-4359770668533141842?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/f_UeUmL8P8VR3Ri2cO6L9wWFiYQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/f_UeUmL8P8VR3Ri2cO6L9wWFiYQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/f_UeUmL8P8VR3Ri2cO6L9wWFiYQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/f_UeUmL8P8VR3Ri2cO6L9wWFiYQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=iVzHdZZ42ws:Ljs1ovb6-F4:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=iVzHdZZ42ws:Ljs1ovb6-F4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=iVzHdZZ42ws:Ljs1ovb6-F4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=iVzHdZZ42ws:Ljs1ovb6-F4:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=iVzHdZZ42ws:Ljs1ovb6-F4:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=iVzHdZZ42ws:Ljs1ovb6-F4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=iVzHdZZ42ws:Ljs1ovb6-F4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=iVzHdZZ42ws:Ljs1ovb6-F4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=iVzHdZZ42ws:Ljs1ovb6-F4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/iVzHdZZ42ws" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/4359770668533141842/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=4359770668533141842" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/4359770668533141842?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/4359770668533141842?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/iVzHdZZ42ws/12-buenas-practicas-en-aspnet-mvc.html" title="12 buenas prácticas en ASP.NET MVC" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/11/12-buenas-practicas-en-aspnet-mvc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04GQX4yeyp7ImA9WxNUEkU.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-1937351189211316288</id><published>2009-11-04T00:12:00.000+01:00</published><updated>2009-11-04T00:12:00.093+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-04T00:12:00.093+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="vb.net" /><category scheme="http://www.blogger.com/atom/ns#" term=".net" /><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><category scheme="http://www.blogger.com/atom/ns#" term="trucos" /><title>Cadenas nulas, vacías o en blanco</title><content type="html">&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Cadenas" border="0" alt="Cadenas" align="right" src="http://lh6.ggpht.com/_O9D62hXq-ng/SuWAOC5QCII/AAAAAAAABIo/DXeNGUPTs7g/image%5B4%5D.png?imgmax=800" width="185" height="132" /&gt; Encuentro en el blog de &lt;a title=".Net Framework 4.0 string.IsNullOrWhiteSpace() method - Gunnar Peipman&amp;#39;s ASP.NET blog" href="http://weblogs.asp.net/gunnarpeipman/archive/2009/10/25/net-framework-4-0-string-isnullorwhitespace-method.aspx" hreflang="en"&gt;Gunnar Peipman&lt;/a&gt;&lt;a title=".Net Framework 4.0 string.IsNullOrWhiteSpace() method - Gunnar Peipman&amp;#39;s ASP.NET blog" href="http://weblogs.asp.net/gunnarpeipman/archive/2009/10/25/net-framework-4-0-string-isnullorwhitespace-method.aspx"&gt;&lt;/a&gt; un post sobre el nuevo método &lt;a title="string.IsNullOrWhiteSpace en MSDN" href="http://msdn.microsoft.com/en-us/library/system.string.isnullorwhitespace(VS.100).aspx"&gt;&lt;/a&gt;&lt;a title="string.IsNullOrWhiteSpace en MSDN" href="http://msdn.microsoft.com/en-us/library/system.string.isnullorwhitespace(VS.100).aspx" hreflang="en"&gt;string.IsNullOrWhiteSpace&lt;/a&gt;, aparecido en .NET Framework 4.0 Beta 2, cuya misión es retornar un booleano indicando si la cadena pasada como parámetro contiene un nulo, está vacío, o exclusivamente caracteres de espaciado (espacios, saltos de línea, tabulaciones, etc.), un escenario bastante frecuente cuando estamos, por ejemplo, validando formularios o cualquier tipo de datos de entrada.&lt;/p&gt;  &lt;p&gt;Por si no podemos esperar hasta la llegada de la nueva versión del framework, Gunnar propone una solución temporal basada en crear un &lt;a title="Métodos de extensión en C#" href="http://www.variablenotfound.com/2008/02/mtodos-de-extensin-en-c.html"&gt;método de extensión&lt;/a&gt; sobre la clase &lt;code&gt;string&lt;/code&gt; que realice la misma tarea:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; StringHelper&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; IsNullOrWhiteSpace(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; s)&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (s == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (s.Trim() == &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Empty);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;div&gt;Como ya &lt;a title="Saber si una cadena está vacía utilizando métodos de extensión" href="http://www.variablenotfound.com/2008/02/saber-si-una-cadena-est-vaca-usando.html"&gt;comenté por aquí&lt;/a&gt; hace tiempo, la ventaja que tiene utilizar esta técnica es que permite invocar el método sobre una instancia de cadena, aunque ésta sea nula, sin riesgo a errores:&lt;/div&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; a = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; b = &lt;span style="color: #006080"&gt;&amp;quot;    &amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; c = &lt;span style="color: #006080"&gt;&amp;quot;\n&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; d = &lt;span style="color: #006080"&gt;&amp;quot;Hey!&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;Console.Write (a.IsNullOrWhiteSpace()); &lt;span style="color: #008000"&gt;// True&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;Console.Write (b.IsNullOrWhiteSpace()); &lt;span style="color: #008000"&gt;// True&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;Console.Write (c.IsNullOrWhiteSpace()); &lt;span style="color: #008000"&gt;// True&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;Console.Write (d.IsNullOrWhiteSpace()); &lt;span style="color: #008000"&gt;// False&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Y para los fieles a Visual Basic .NET, ahí va el código equivalente:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;Imports&lt;/span&gt; System.Runtime.CompilerServices&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Module&lt;/span&gt; StringHelper&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &amp;lt;Extension()&amp;gt; _&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Function&lt;/span&gt; IsNullOrWhiteSpace(&lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; s &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Boolean&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;If&lt;/span&gt; s &lt;span style="color: #0000ff"&gt;Is&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Nothing&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Then&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;Return&lt;/span&gt; &lt;font color="#0000ff"&gt;True&lt;/font&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;If&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;Return&lt;/span&gt; s.Trim() = &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;.Empty&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Function&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Module&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-1937351189211316288?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/kN8zE27ce6PXRtXIrc9FSC4TzYc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kN8zE27ce6PXRtXIrc9FSC4TzYc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/kN8zE27ce6PXRtXIrc9FSC4TzYc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kN8zE27ce6PXRtXIrc9FSC4TzYc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=bW2P1KI3XdA:jp-Rh0cISsY:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=bW2P1KI3XdA:jp-Rh0cISsY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=bW2P1KI3XdA:jp-Rh0cISsY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=bW2P1KI3XdA:jp-Rh0cISsY:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=bW2P1KI3XdA:jp-Rh0cISsY:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=bW2P1KI3XdA:jp-Rh0cISsY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=bW2P1KI3XdA:jp-Rh0cISsY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=bW2P1KI3XdA:jp-Rh0cISsY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=bW2P1KI3XdA:jp-Rh0cISsY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/bW2P1KI3XdA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/1937351189211316288/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=1937351189211316288" title="2 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/1937351189211316288?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/1937351189211316288?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/bW2P1KI3XdA/cadenas-nulas-vacias-o-en-blanco.html" title="Cadenas nulas, vacías o en blanco" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/11/cadenas-nulas-vacias-o-en-blanco.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQDRHg8eSp7ImA9WxNUEk4.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-6718055733302509787</id><published>2009-11-02T23:50:00.001+01:00</published><updated>2009-11-03T09:52:55.671+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-03T09:52:55.671+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="buenas prácticas" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><category scheme="http://www.blogger.com/atom/ns#" term="aspnetmvc" /><category scheme="http://www.blogger.com/atom/ns#" term="patrones" /><title>El patrón Post-Redirect-Get</title><content type="html">&lt;p&gt;Hoy vamos a dedicar un rato a comentar una técnica que es considerada una buena práctica en el desarrollo de aplicaciones web: el patrón PRG o Post-Redirect-Get. Seguramente alguna vez lo haya citado por aquí, pero nunca lo había explicado en profundidad.&lt;/p&gt;  &lt;p&gt;Por último, antes de entrar en materia, es conveniente indicar que lo que vamos a ver es válido para ASP.NET Webforms, ASP.NET MVC y, en general, para cualquier tecnología de construcción de sitios web que incluya componentes en servidor, puesto que se trata de una forma de hacer las cosas, no de la implementación de una solución. Ya en el último epígrafe veremos implementaciones concretas para Webforms y el framework MVC.&lt;/p&gt;  &lt;h4&gt;El problema&lt;/h4&gt;  &lt;p&gt;Es bastante habitual que al desarrollar aplicaciones para la web creemos un formulario de introducción de datos, y lo normal es que estos envíen los datos al servidor utilizando el verbo HTTP Post. Hasta aquí, bien.&lt;/p&gt;  &lt;p&gt;Cuando desde el servidor se recibe una petición de este tipo normalmente se ejecuta un código, por ejemplo para almacenar la información en la base de datos y, de forma bastante frecuente, aprovechamos para enviar al cliente feedback de que su operación ha sido realizada con éxito. Y aquí es donde aparece el problema.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px 5px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://lh5.ggpht.com/_O9D62hXq-ng/SuiTd811QqI/AAAAAAAABI8/0grC6w7Qqmk/image%5B3%5D.png?imgmax=800" width="322" height="147" /&gt; Si el usuario, por esas ocurrencias que suele tener ;-), decide pulsar F5 o actualizar la página en el navegador, se van a producir dos efectos desagradables:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;primero, se le mostrará al usuario un cuadro de diálogo informándolo de algo que difícilmente va a entender y que, en cualquier caso, le asustará bastante. El navegador le informa de que está realizando un reenvío completo de los datos del formulario.     &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;segundo, una vez superado el escollo anterior, se volvería a ejecutar en servidor toda la lógica asociada a la recepción de datos del formulario con consecuencias, a veces terribles, como el almacenamiento de registros duplicados en la base de datos.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;¿Cómo podemos evitar esto?&lt;/p&gt;  &lt;h4&gt;La solución: Post-Redirect-Get&lt;/h4&gt;  &lt;p&gt;El patrón PRG viene a indicarnos una forma de diseñar nuestras aplicaciones pensando en evitar los problemas descritos anteriormente, y, como veremos, es bastante simple. El procedimiento general a seguir sería:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Recibimos la petición &lt;u&gt;&lt;strong&gt;Post&lt;/strong&gt;&lt;/u&gt; con los datos que ha introducido el usuario en un formulario.&lt;/li&gt;    &lt;li&gt;Ejecutamos la lógica asociada a la recepción de dicho formulario, por ejemplo, grabar en la base de datos.&lt;/li&gt;    &lt;li&gt;Enviamos al cliente una respuesta con código HTTP 30x (&lt;u&gt;&lt;strong&gt;Redirect&lt;/strong&gt;&lt;/u&gt;), indicando al agente de usuario que debe solicitar otra página, en la mostraremos un mensaje informando de que el proceso se ha realizado con éxito.&lt;/li&gt;    &lt;li&gt;El navegador obtiene dicha página mediante una petición de tipo &lt;u&gt;&lt;strong&gt;Get&lt;/strong&gt;&lt;/u&gt;.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;En este punto, si el usuario decide &lt;strike&gt;(o el diablo que lleva dentro le ordena ;-))&lt;/strike&gt; refrescar la página, lo único que conseguirá será que su navegador vuelva a solicitar la página en la que le estamos informando de que el proceso ha sido satisfactorio. No se le muestra ningún cuadro de diálogo amenazante, ni se ejecuta la lógica de nuevo, ni hay ningún tipo de daños colaterales.&lt;/p&gt;  &lt;p&gt;El siguiente diagrama, basado en el de la imprescindible &lt;a title="PRG en Wikipedia" href="http://en.wikipedia.org/wiki/Post/Redirect/Get" target="_blank"&gt;Wikipedia&lt;/a&gt;, muestra gráficamente este proceso:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px auto 5px; display: block; float: none; border-top: 0px; border-right: 0px" title="Secuencia en el patrón PRG" border="0" alt="Secuencia en el patrón PRG" src="http://lh6.ggpht.com/_O9D62hXq-ng/SuiTfK1RApI/AAAAAAAABJA/656i4q5Ojkk/image%5B13%5D.png?imgmax=800" width="459" height="376" /&gt; &lt;/p&gt;  &lt;h4&gt;&lt;/h4&gt;  &lt;h4&gt;¿Un poco de código? Sí, por favor&lt;/h4&gt;  &lt;h5&gt;ASP.NET WebForms&lt;/h5&gt;  &lt;p&gt;La abstracción sobre los protocolos montada por la tecnología Webforms hace más difícil reconocer los conceptos que estamos tratando, pero aún así es bastante sencillo aplicar el patrón.&lt;/p&gt;  &lt;p&gt;En los formularios web, los postbacks se realizan a través de métodos Http POST, por lo que la implementación de la lógica y la redirección podremos realizarlas en la implementación del evento de servidor correspondiente, por ejemplo, el de pulsación de un botón:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; btnAceptar_Click(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Page.IsValid)&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #008000"&gt;// Lógica &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        Cliente cliente = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Cliente(txtNombre.Text, txtApellidos.Text);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        GestorDeClientes.Salvar(cliente);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #008000"&gt;// Redirección&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        Response.Redirect(&lt;span style="color: #006080"&gt;&amp;quot;clientes.aspx&amp;quot;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;La página “clientes.aspx” podría ser ser el listado de clientes registrados en el sistema, por ejemplo.&lt;/p&gt;&lt;h5&gt;ASP.NET MVC&lt;/h5&gt;&lt;p&gt;En el framework MVC, por su cercanía a los protocolos, sí es fácil identificar los conceptos de petición y redirecciones. El siguiente código sería equivalente al anteriormente mostrado, pero enviando al usuario a la acción “Index”:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;[HandleError]&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; ClientesController : Controller&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    ... &lt;span style="color: #008000"&gt;// Otras acciones&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [AcceptVerbs(HttpVerbs.Post)]&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ActionResult Editar(Cliente cliente)&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (ModelState.IsValid)&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            GestorDeClientes.Grabar(cliente);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; RedirectToAction(&lt;span style="color: #006080"&gt;&amp;quot;Index&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; View(cliente);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-6718055733302509787?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XZt_MkXUWJ1xyEU9dq5LcZoM6CI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XZt_MkXUWJ1xyEU9dq5LcZoM6CI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XZt_MkXUWJ1xyEU9dq5LcZoM6CI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XZt_MkXUWJ1xyEU9dq5LcZoM6CI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=3l1HhQ17A6A:Piwf5LRm_94:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=3l1HhQ17A6A:Piwf5LRm_94:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=3l1HhQ17A6A:Piwf5LRm_94:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=3l1HhQ17A6A:Piwf5LRm_94:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=3l1HhQ17A6A:Piwf5LRm_94:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=3l1HhQ17A6A:Piwf5LRm_94:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=3l1HhQ17A6A:Piwf5LRm_94:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=3l1HhQ17A6A:Piwf5LRm_94:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=3l1HhQ17A6A:Piwf5LRm_94:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/3l1HhQ17A6A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/6718055733302509787/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=6718055733302509787" title="2 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/6718055733302509787?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/6718055733302509787?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/3l1HhQ17A6A/el-patron-post-redirect-get.html" title="El patrón Post-Redirect-Get" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/11/el-patron-post-redirect-get.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcCQXw_cSp7ImA9WxNVGEg.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-4425737153157361621</id><published>2009-10-29T23:41:00.000+01:00</published><updated>2009-10-29T23:41:00.249+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-29T23:41:00.249+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="noticias" /><category scheme="http://www.blogger.com/atom/ns#" term="blogging" /><category scheme="http://www.blogger.com/atom/ns#" term="redes sociales" /><title>Variable not found en Facebook</title><content type="html">&lt;p&gt;Antes se solía decir que si no estabas en Internet, no existías; ahora que todo el mundo está en Internet, parece ser que si no estás en las redes sociales no existes. Cosas de la evolución, supongo ;-)&lt;/p&gt;  &lt;p&gt;Y aunque no soy muy amigo de este tipo de afirmaciones, por si acaso, en un auténtico alarde de socialización, he creado el sitio &lt;a title="Variable not found en Facebook" href="http://www.facebook.com/pages/Variable-not-found/94490426991" target="_blank"&gt;Variable not found en Facebook&lt;/a&gt;, que pongo a vuestra disposición para mantenernos en contacto de una forma algo más bidireccional de lo acostumbrado:&lt;/p&gt;  &lt;p&gt;&lt;a title="Variable not found en Facebook" href="http://www.facebook.com/pages/Variable-not-found/94490426991" target="_blank"&gt;&lt;img style="border-right-width: 0px; margin: 0px auto 5px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Variable not found en Facebook" border="0" alt="Variable not found en Facebook" src="http://lh6.ggpht.com/_O9D62hXq-ng/SughlU_8OBI/AAAAAAAABI0/vga2TwqHsBk/image%5B22%5D.png?imgmax=800" width="468" height="364" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Espero que nos veamos también por allí. Y sobre todo, que incrementemos el triste número de fans que tiene hasta el momento… :-DDD&lt;/p&gt;  &lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-4425737153157361621?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8wELdMDS2HeerAOxCwpUTKIJ9w0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8wELdMDS2HeerAOxCwpUTKIJ9w0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8wELdMDS2HeerAOxCwpUTKIJ9w0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8wELdMDS2HeerAOxCwpUTKIJ9w0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=KxQo_DlFUSI:POL1LWPHjF8:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=KxQo_DlFUSI:POL1LWPHjF8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=KxQo_DlFUSI:POL1LWPHjF8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=KxQo_DlFUSI:POL1LWPHjF8:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=KxQo_DlFUSI:POL1LWPHjF8:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=KxQo_DlFUSI:POL1LWPHjF8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=KxQo_DlFUSI:POL1LWPHjF8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=KxQo_DlFUSI:POL1LWPHjF8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=KxQo_DlFUSI:POL1LWPHjF8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/KxQo_DlFUSI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/4425737153157361621/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=4425737153157361621" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/4425737153157361621?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/4425737153157361621?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/KxQo_DlFUSI/variable-not-found-en-facebook.html" title="Variable not found en Facebook" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/10/variable-not-found-en-facebook.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D08GQX84eip7ImA9WxNVF0s.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-426781740341569584</id><published>2009-10-28T22:37:00.000+01:00</published><updated>2009-10-28T22:37:00.132+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-28T22:37:00.132+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="trucos" /><category scheme="http://www.blogger.com/atom/ns#" term="flash" /><title>Modifica el portapapeles de tus visitantes con ZeroClipboard</title><content type="html">&lt;p&gt;Si estás creando herramientas webs que generan código o texto para que tus visitantes lo copien y peguen en otras aplicaciones, &lt;a title="ZeroClipboard, en Google Code" href="http://code.google.com/p/zeroclipboard/"&gt;ZeroClipboard&lt;/a&gt; puede facilitar su utilización, al permitir introducir el contenido que deseemos en el portapapeles de los usuarios.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 5px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="right" src="http://lh5.ggpht.com/_O9D62hXq-ng/SuNY6gyr2wI/AAAAAAAABIk/O7ZMMRFfFLQ/image%5B3%5D.png?imgmax=800" width="296" height="137" /&gt; Hace tiempo ya comenté &lt;a title="Espía a tus visitantes con Ajax" href="http://www.variablenotfound.com/2007/06/espa-tus-visitantes-con-ajax.html"&gt;una forma de acceder transparentemente al portapapeles de los visitantes&lt;/a&gt; utilizando el objeto &lt;code&gt;window.clipboardData&lt;/code&gt;, pero esta posibilidad desapareció, al menos en su versión silenciosa, conforme los navegadores fueron tomándose más en serio los temas de seguridad. A día de hoy, si intentamos utilizar estas funciones desde Explorer, aparece un cuadro de diálogo de confirmación algo molesto, para alertar al usuario de que el script de una página está intentando acceder a dicha información.&lt;/p&gt;  &lt;p&gt;ZeroClipboard es una pequeña librería javascript que utiliza una película flash para acceder al portapapeles en modo “escritura”, es decir, para introducir en él un valor generado desde un script como respuesta a una acción del usuario como la pulsación de un botón o enlace. Podéis verlo en acción en esta &lt;a title="Demo de ZeroClipboard" href="http://bowser.macminicolo.net/~jhuckaby/zeroclipboard/"&gt;demo online&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;El siguiente código muestra cómo podemos utilizarlo. Creamos un &lt;code&gt;&amp;lt;textarea&amp;gt;&lt;/code&gt; cuyo evento &lt;code&gt;onchange&lt;/code&gt; aprovechamos para ir almacenando el contenido que pasará al portapapeles cuando el usuario pulse el enlace (&lt;code&gt;btnCopiar&lt;/code&gt;) al que hemos vinculado este comportamiento:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:755b7cfc-f943-4815-bf45-6a19424768e3" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:White;overflow: auto;"&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;html &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;head&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;title&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Prueba de ZeroClipboard&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;title&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;script &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;type&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="text/javascript"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; src&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="ZeroClipboard.js"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;script&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;head&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;body&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;textarea &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;id&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="texto"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; rows&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="10"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; cols&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="10"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; &lt;br /&gt;              onchange&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="clip.setText(this.value);"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;textarea&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;br &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;a &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;id&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="btnCopiar"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; href&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="#"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Copiar&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;a&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;body&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;script &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;type&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="text/javascript"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background-color: #F5F5F5; color: #000000;"&gt;&lt;br /&gt;    clip &lt;/span&gt;&lt;span style="background-color: #F5F5F5; color: #000000;"&gt;=&lt;/span&gt;&lt;span style="background-color: #F5F5F5; color: #000000;"&gt; &lt;/span&gt;&lt;span style="background-color: #F5F5F5; color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="background-color: #F5F5F5; color: #000000;"&gt; ZeroClipboard.Client();&lt;br /&gt;    clip.glue(&lt;/span&gt;&lt;span style="background-color: #F5F5F5; color: #000000;"&gt;'&lt;/span&gt;&lt;span style="background-color: #F5F5F5; color: #000000;"&gt;btnCopiar&lt;/span&gt;&lt;span style="background-color: #F5F5F5; color: #000000;"&gt;'&lt;/span&gt;&lt;span style="background-color: #F5F5F5; color: #000000;"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;script&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;html&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;p&gt;Si lo probáis, podréis ver que en ningún momento se alerta al usuario de que su portapapeles va a ser modificado, quedando muy limpio y profesional. :-) &lt;/p&gt;&lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-426781740341569584?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eSEsDGVtZloH8YGcAL68bnGIFaI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eSEsDGVtZloH8YGcAL68bnGIFaI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eSEsDGVtZloH8YGcAL68bnGIFaI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eSEsDGVtZloH8YGcAL68bnGIFaI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=jCgQ8W2i7So:EY7x6EJhWl4:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=jCgQ8W2i7So:EY7x6EJhWl4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=jCgQ8W2i7So:EY7x6EJhWl4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=jCgQ8W2i7So:EY7x6EJhWl4:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=jCgQ8W2i7So:EY7x6EJhWl4:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=jCgQ8W2i7So:EY7x6EJhWl4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=jCgQ8W2i7So:EY7x6EJhWl4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=jCgQ8W2i7So:EY7x6EJhWl4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=jCgQ8W2i7So:EY7x6EJhWl4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/jCgQ8W2i7So" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/426781740341569584/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=426781740341569584" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/426781740341569584?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/426781740341569584?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/jCgQ8W2i7So/modifica-el-portapapeles-de-tus.html" title="Modifica el portapapeles de tus visitantes con ZeroClipboard" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/10/modifica-el-portapapeles-de-tus.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQAQX04fip7ImA9WxNVFUQ.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-1612222488253071564</id><published>2009-10-26T23:49:00.000+01:00</published><updated>2009-10-26T23:49:00.336+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-26T23:49:00.336+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jqGrid" /><category scheme="http://www.blogger.com/atom/ns#" term="jquery" /><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><category scheme="http://www.blogger.com/atom/ns#" term="aspnetmvc" /><category scheme="http://www.blogger.com/atom/ns#" term="componentes" /><title>jqGrid: Grids espectaculares para ASP.NET MVC, paso a paso</title><content type="html">&lt;p&gt;&lt;a title="Scott Hanselman&amp;#39;s Computer Zen" href="http://www.hanselman.com/blog/ASPNETMVCWebFormsUnplugged.aspx"&gt;&lt;/a&gt;&lt;a title="Scott Hanselman&amp;#39;s Computer Zen" href="http://www.hanselman.com/blog/ASPNETMVCWebFormsUnplugged.aspx" hreflang="en"&gt;Dicen las malas lenguas&lt;/a&gt; ;-) que durante una reunión del equipo de diseño de ASP.NET MVC alguien dijo: “necesitaremos un control tipo Repeater”, refiriéndose a algún tipo de mecanismo para mostrar datos tabulados de forma sencilla. Y la respuesta del jefe técnico fue, “ya lo tenemos: se llama bucle foreach”. &lt;/p&gt;  &lt;p&gt;Anécdotas aparte, es cierto que en ASP.NET MVC 1.0 no existe otro mecanismo que el bucle de toda la vida para mostrar datos en tablas, la típica rejilla con información sobre elementos de una colección tan habitual en nuestras aplicaciones. La máxima ayuda que tenemos “de serie” es el andamiaje generado por Visual Studio a la hora de generar una vista sobre una enumeración de elementos, que es válida únicamente en escenarios muy sencillos.&lt;/p&gt;  &lt;p&gt;Y aquí es donde entra &lt;a title="jQuery Grid Plugin" href="http://www.trirand.com/blog/" hreflang="en"&gt;jQuery Grid Plugin&lt;/a&gt;&lt;a title="jQuery Grid Plugin" href="http://www.trirand.com/blog/"&gt;&lt;/a&gt; (&lt;strong&gt;jqGrid&lt;/strong&gt; para los amigos), un plugin para jQuery que se integra perfectamente con ASP.NET MVC y que permite simplificar enormemente el desarrollo&amp;#160; de vistas de tipo grid ofreciendo al mismo tiempo unas funcionalidades espectaculares: paginación, carga de datos de forma asíncrona vía Ajax, ordenación y redimensionado de columnas, edición de celdas, interfaz multi-idioma basado en temas, y &lt;a title="Características de jqGrid" href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:features" hreflang="en"&gt;un larguísimo etcétera&lt;/a&gt;&lt;a title="Características de jqGrid" href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:features"&gt;&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;En este post vamos a implementar un grid simple de consulta de datos utilizando jqGrid 3.5 y ASP.NET MVC 1.0, paso a paso. Además, al final del post encontraréis un enlace para descargar el proyecto de demostración para Visual Studio 2008 Express.&lt;/p&gt;  &lt;h3&gt;1. Descargamos jqGrid&lt;/h3&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 5px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Descarga de jqGrid" border="0" alt="Descarga de jqGrid" align="right" src="http://lh4.ggpht.com/_O9D62hXq-ng/SuL1LRNgRXI/AAAAAAAABIY/n3b__m6favY/image5.png?imgmax=800" width="239" height="210" /&gt;Lo primero, como siempre, es descargar los componentes necesarios. Para hacernos con jqGrid, es necesario visitar la página de &lt;a title="Descargar jqGrid" href="http://www.trirand.com/blog/?page_id=6"&gt;descargas&lt;/a&gt; del proyecto, en la que podemos encontrar un selector que nos permitirá elegir los módulos asociados a las funcionalidades que vayamos a utilizar.&lt;/p&gt;  &lt;p&gt;En nuestro caso, dado que vamos a implementar un escenario muy simple, seleccionaremos únicamente el módulo “Grid base” y pulsamos el botón &lt;em&gt;download&lt;/em&gt; situado en el pie de la tabla.&lt;/p&gt;  &lt;p&gt;La descarga es un archivo .zip bastante ligerito cuyo contenido utilizamos así:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;code&gt;jquery.jqGrid.min.js&lt;/code&gt;, que encontraréis en la carpeta “js” del archivo descargado, lo copiamos a la carpeta “scripts” del proyecto ASP.NET MVC. &lt;/li&gt;    &lt;li&gt;&lt;code&gt;grid.locale-sp.js&lt;/code&gt; , el archivo de localización al español que encontraremos en la carpeta “js/i18n” del .zip, lo copiamos también a la carpeta “scripts” del proyecto. &lt;/li&gt;    &lt;li&gt;&lt;code&gt;ui.jqgrid.css&lt;/code&gt; , disponible en la carpeta “css” del archivo comprimido, lo pasamos a la carpeta “content” del proyecto. &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 5px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Archivos del proyecto" border="0" alt="Archivos del proyecto" align="right" src="http://lh5.ggpht.com/_O9D62hXq-ng/SuL1L2jbhhI/AAAAAAAABIc/G4l2-ro3UMU/image13.png?imgmax=800" width="260" height="301" /&gt; 2. Descargamos un tema visual&lt;/h3&gt;  &lt;p&gt;jqGrid utiliza los temas visuales de &lt;a title="jQuery UI" href="http://www.jqueryui.com/"&gt;jQuery UI&lt;/a&gt; para componer el interfaz, por lo que es necesario &lt;a title="Temas jQuery UI" href="http://www.jqueryui.com/themeroller/"&gt;descargar&lt;/a&gt; alguno de los disponibles o bien crear uno personalizado con la herramienta on-line disponible en su página. Para nuestro ejemplo, vamos a utilizar el tema “&lt;a title="Tema Cupertino" href="http://www.jqueryui.com/download/?themeParams=%3FffDefault%3DLucida+Grande%252C+Lucida+Sans%252C+Arial%252C+sans-serif%26fwDefault%3Dbold%26fsDefault%3D1.1em%26cornerRadius%3D6px%26bgColorHeader%3Ddeedf7%26bgTextureHeader%3D03_highlight_soft.png%26bgImgOpacityHeader%3D100%26borderColorHeader%3Daed0ea%26fcHeader%3D222222%26iconColorHeader%3D72a7cf%26bgColorContent%3Df2f5f7%26bgTextureContent%3D04_highlight_hard.png%26bgImgOpacityContent%3D100%26borderColorContent%3Ddddddd%26fcContent%3D362b36%26iconColorContent%3D72a7cf%26bgColorDefault%3Dd7ebf9%26bgTextureDefault%3D02_glass.png%26bgImgOpacityDefault%3D80%26borderColorDefault%3Daed0ea%26fcDefault%3D2779aa%26iconColorDefault%3D3d80b3%26bgColorHover%3De4f1fb%26bgTextureHover%3D02_glass.png%26bgImgOpacityHover%3D100%26borderColorHover%3D74b2e2%26fcHover%3D0070a3%26iconColorHover%3D2694e8%26bgColorActive%3D3baae3%26bgTextureActive%3D02_glass.png%26bgImgOpacityActive%3D50%26borderColorActive%3D2694e8%26fcActive%3Dffffff%26iconColorActive%3Dffffff%26bgColorHighlight%3Dffef8f%26bgTextureHighlight%3D03_highlight_soft.png%26bgImgOpacityHighlight%3D25%26borderColorHighlight%3Df9dd34%26fcHighlight%3D363636%26iconColorHighlight%3D2e83ff%26bgColorError%3Dcd0a0a%26bgTextureError%3D01_flat.png%26bgImgOpacityError%3D15%26borderColorError%3Dcd0a0a%26fcError%3Dffffff%26iconColorError%3Dffffff%26bgColorOverlay%3Deeeeee%26bgTextureOverlay%3D08_diagonals_thick.png%26bgImgOpacityOverlay%3D90%26opacityOverlay%3D80%26bgColorShadow%3D000000%26bgTextureShadow%3D04_highlight_hard.png%26bgImgOpacityShadow%3D70%26opacityShadow%3D30%26thicknessShadow%3D7px%26offsetTopShadow%3D-7px%26offsetLeftShadow%3D-7px%26cornerRadiusShadow%3D8px"&gt;Cupertino&lt;/a&gt;”.&lt;/p&gt;  &lt;p&gt;Como en el caso anterior, &lt;a title="Descargar jQuery UI" href="http://www.trirand.com/blog/?page_id=6"&gt;seleccionamos los componentes&lt;/a&gt; a obtener (en principio, basta con UI Core a no ser que vayáis a utilizar esta librería para otras cosas), el tema, y pulsamos el botón &lt;em&gt;download&lt;/em&gt;. Descargaremos un archivo .zip en cuyo&amp;#160; interior encontramos, dentro de la carpeta “css”, una subcarpeta con el nombre del tema elegido y que copiamos a la carpeta “content” del proyecto MVC.&lt;/p&gt;  &lt;p&gt;La imagen anterior muestra la distribución de los archivos descritos hasta el momento en las distintas carpetas en las que hay que colocarlos.&lt;/p&gt;  &lt;h3&gt;3. Incluimos los componentes en el proyecto ASP.NET MVC&lt;/h3&gt;  &lt;p&gt;Tras crear el proyecto ASP.NET MVC, vamos a incluirle ahora las referencias a librerías y archivos necesarios para poder utilizar jqGrid. &lt;/p&gt;  &lt;p&gt;Básicamente, tendremos que incluir en las páginas donde vayamos a utilizarlo referencias a jQuery, jqGrid, el archivo de localización, la hoja de estilos utilizada por jqGrid, y el tema que estemos empleando. Lo más fácil es hacerlo a nivel de página maestra, por ejemplo así:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;lt;head runat=&lt;span style="color: #006080"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &amp;lt;title&amp;gt;&amp;lt;asp:ContentPlaceHolder ID=&lt;span style="color: #006080"&gt;&amp;quot;TitleContent&amp;quot;&lt;/span&gt; runat=&lt;span style="color: #006080"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; /&amp;gt;&amp;lt;/title&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &amp;lt;link href=&lt;span style="color: #006080"&gt;&amp;quot;../../Content/Site.css&amp;quot;&lt;/span&gt; rel=&lt;span style="color: #006080"&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; type=&lt;span style="color: #006080"&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &amp;lt;link href=&lt;span style="color: #006080"&gt;&amp;quot;../../Content/ui.jqgrid.css&amp;quot;&lt;/span&gt; rel=&lt;span style="color: #006080"&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; type=&lt;span style="color: #006080"&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &amp;lt;link href=&lt;span style="color: #006080"&gt;&amp;quot;../../Content/cupertino/jquery-ui-1.7.2.custom.css&amp;quot;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;          rel=&lt;span style="color: #006080"&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; type=&lt;span style="color: #006080"&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &amp;lt;script src=&lt;span style="color: #006080"&gt;&amp;quot;../../Scripts/jquery-1.3.2.min.js&amp;quot;&lt;/span&gt; type=&lt;span style="color: #006080"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &amp;lt;script src=&lt;span style="color: #006080"&gt;&amp;quot;../../Scripts/grid.locale-sp.js&amp;quot;&lt;/span&gt; type=&lt;span style="color: #006080"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &amp;lt;script src=&lt;span style="color: #006080"&gt;&amp;quot;../../Scripts/jquery.jqGrid.min.js&amp;quot;&lt;/span&gt; type=&lt;span style="color: #006080"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;lt;/head&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Es importante incluir todos los archivos y en el orden correcto, de lo contrario el plugin no funcionará correctamente.&lt;/p&gt;&lt;h3&gt;4. El modelo&lt;/h3&gt;&lt;p&gt;En lugar de utilizar una base de datos, vamos a crear una simulación en memoria de un almacén de datos personales basado en la siguiente entidad:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Amigo&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Id { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Nombre { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Apellidos { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; DateTime FechaDeNacimiento { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Email { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;La lógica de negocio está implementada en la clase &lt;code&gt;GestorDeAmigos&lt;/code&gt;, que incluye, además del constructor que carga los datos iniciales en el almacén (una colección de tipo &lt;code&gt;List&amp;lt;Amigo&amp;gt;&lt;/code&gt; , los siguientes métodos:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IEnumerable&amp;lt;Amigo&amp;gt; ObtenerAmigos(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; pagina, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; elementosPorPagina, &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                                        Func&amp;lt;Amigo, IComparable&amp;gt; orden, &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                                        Ordenacion ordenacion)&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    IEnumerable&amp;lt;Amigo&amp;gt; datos;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (ordenacion==Ordenacion.Ascendente)&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        datos = datosAmigos.OrderBy(orden);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        datos = datosAmigos.OrderByDescending(orden);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; datos.Skip((pagina - 1) * elementosPorPagina).Take(elementosPorPagina);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; ContarAmigos()&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; datosAmigos.Count;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Del código anterior, sólo comentar los parámetros del método ObtenerAmigos:&lt;/p&gt;&lt;ul&gt;  &lt;li&gt;&lt;code&gt;pagina&lt;/code&gt; y &lt;code&gt;elementosPorPagina&lt;/code&gt;, indican, respectivamente el número de página de datos a mostrar y el número de registros máximo a mostrar en cada una de ellas. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;orden &lt;/code&gt;es una &lt;a title="Desmitificando las expresiones lambda" href="http://www.variablenotfound.com/2009/03/c-desmitificando-las-expresiones-lambda.html"&gt;lambda&lt;/a&gt; que retorna la expresión por la cual ordenaremos los datos. Si estuviéramos utilizando consultas SQL directas o LINQ to SQL podríamos usar otros enfoques, como la construcción de queries dinámicas o &lt;a title="Dynamic LINQ(Parte 1 Usando la librería de LINQ Dynamic) « Thinking in .NET" href="http://thinkingindotnet.wordpress.com/2008/01/08/dynamic-linqparte-1-usando-la-libreria-de-linq-dynamic/"&gt;Dynamic LINQ&lt;/a&gt;. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;ordenacion&lt;/code&gt; indica, usando una enumeración, si el orden es ascendente o descendente. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Así, a continuación puede verse un ejemplo de lo simple que quedaría una llamada a este método, flexible pero con tipado fuerte:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;var amigos = gestorDeAmigos.ObtenerAmigos(&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                   1,                       &lt;span style="color: #008000"&gt;// Página actual&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                   25,                      &lt;span style="color: #008000"&gt;// Registros por página&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                   amigo=&amp;gt;amigo.Apellidos,  &lt;span style="color: #008000"&gt;// Expresión de ordenación&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                   Ordenacion.Ascendente    &lt;span style="color: #008000"&gt;// Orden&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;             );&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;5. El controlador&lt;/h3&gt;&lt;p&gt;Una de las principales ventajas que ofrece jqGrid es que la carga de los datos la realiza mediante peticiones Ajax. En la práctica, esto significa que irá lanzando llamadas a una acción de nuestro controlador para solicitarle la información conforme vaya necesitando datos, por ejemplo, durante la carga inicial de la página o cuando el usuario utiliza las herramientas de paginación, enviándole los siguientes parámetros:&lt;/p&gt;&lt;ul&gt;  &lt;li&gt;&lt;code&gt;sidx&lt;/code&gt;, el índice o nombre del campo de ordenación actual. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;sord&lt;/code&gt;, “asc” o “desc”, indicando si el orden es ascendente o descendente. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;page&lt;/code&gt;, el número de página actual. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;rows&lt;/code&gt;, número de elementos a obtener para completar la página. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;El retorno de este método de acción debe ser un objeto serializado en JSON (aunque también permite XML) y ha de ajustarse a un formato especificado en la documentación, que es el que jqGrid espera recibir, algo como:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{ &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  total: &lt;span style="color: #006080"&gt;&amp;quot;xxx&amp;quot;&lt;/span&gt;, &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  page: &lt;span style="color: #006080"&gt;&amp;quot;yyy&amp;quot;&lt;/span&gt;, &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  records: &lt;span style="color: #006080"&gt;&amp;quot;zzz&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  rows : [&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {id:&lt;span style="color: #006080"&gt;&amp;quot;1&amp;quot;&lt;/span&gt;, cell:[&lt;span style="color: #006080"&gt;&amp;quot;cell11&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;cell12&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;cell13&amp;quot;&lt;/span&gt;]},&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {id:&lt;span style="color: #006080"&gt;&amp;quot;2&amp;quot;&lt;/span&gt;, cell:[&lt;span style="color: #006080"&gt;&amp;quot;cell21&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;cell22&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;cell23&amp;quot;&lt;/span&gt;]},&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      ...&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  ]&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;El método de obtención de datos,&amp;#160; nuestra acción, seguirá normalmente el patrón recogido en el código mostrado a continuación. Si os fijáis, lo único que estamos haciendo es reproducir fielmente esta estructura anterior en un objeto anónimo, de forma que&amp;#160; al transformarlo en JSON (gracias al retorno de tipo &lt;code&gt;JsonResult&lt;/code&gt;) se genere justo lo que necesitamos:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ActionResult ObtenerDatosGrid(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; sidx, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; sord, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; page, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; rows)&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; datos = [...]          &lt;span style="color: #008000"&gt;// Obtener datos del modelo&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; totalRegistros = [...] &lt;span style="color: #008000"&gt;// Contar todos los registros&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; totalPages = (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)Math.Ceiling((&lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;)totalRegistros / (&lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;)rows);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; data = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        total = totalPages,        &lt;span style="color: #008000"&gt;// Total de páginas&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        page = page,               &lt;span style="color: #008000"&gt;// Página actual&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        records = totalRegistros,  &lt;span style="color: #008000"&gt;// Total de registros (obtenido del modelo)&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        rows = from a &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; datos     &lt;span style="color: #008000"&gt;// Datos de filas&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;               select &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                   id = a.Id,                &lt;span style="color: #008000"&gt;// ID único de la fila&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                   cell = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] {     &lt;span style="color: #008000"&gt;// Array de celdas de la fila&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                       a.Apellidos,                             &lt;span style="color: #008000"&gt;// Primera columna,            &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                       a.Nombre,                                &lt;span style="color: #008000"&gt;// Segunda columna,&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                       a.FechaDeNacimiento.ToShortDateString(), &lt;span style="color: #008000"&gt;// Tercera columna,&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                       a.Email                                  &lt;span style="color: #008000"&gt;// Cuarta columna  &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                   }&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;               }&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    };&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; Json(data);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Nuestro ejemplo se ajusta totalmente al patrón anterior, aunque incluiremos código extra para tener en cuenta las ordenaciones indicadas por los parámetros &lt;code&gt;sidx &lt;/code&gt;y &lt;code&gt;sord&lt;/code&gt; en la invocación al modelo. Observad cómo construimos las expresiones de ordenación:&lt;/p&gt;&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ActionResult ObtenerDatosGrid(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; sidx, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; sord, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; page, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; rows)&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;// Establecemos la función de ordenación dependiendo del valor del &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;// parámetro &amp;quot;sidx&amp;quot;, que es el campo de orden actual&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    Func&amp;lt;Amigo, IComparable&amp;gt; funcOrden =&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        sidx == &lt;span style="color: #006080"&gt;&amp;quot;Apellidos&amp;quot;&lt;/span&gt; ? a =&amp;gt; a.Apellidos :&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        sidx == &lt;span style="color: #006080"&gt;&amp;quot;FechaDeNacimiento&amp;quot;&lt;/span&gt; ? a =&amp;gt; a.FechaDeNacimiento :&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        sidx == &lt;span style="color: #006080"&gt;&amp;quot;Email&amp;quot;&lt;/span&gt; ? a =&amp;gt; a.Email :&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        (Func&amp;lt;Amigo, IComparable&amp;gt;)(a =&amp;gt; a.Id);&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;// Establecemos si se trata de orden ascendente o descendente, en&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;// función del parámetro &amp;quot;sord&amp;quot;, que puede valer &amp;quot;asc&amp;quot; o &amp;quot;desc&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    Ordenacion ordenacion = sord == &lt;span style="color: #006080"&gt;&amp;quot;asc&amp;quot;&lt;/span&gt; ? Ordenacion.Ascendente : Ordenacion.Descendente;&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;// Usamos el modelo para obtener los datos&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; datos = gestorDeAmigos.ObtenerAmigos(page, rows, funcOrden, ordenacion);&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; totalRegistros = gestorDeAmigos.ContarAmigos();&lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    ... &lt;/pre&gt;&lt;!--CRLF--&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;h3&gt;6. La vista&lt;/h3&gt;&lt;p&gt;En la vista debemos crear un elemento contenedor, concretamente una tabla XHTML con un identificador único que después usaremos para indicarle al plugin dónde tiene que actuar &lt;em&gt;su magia&lt;/em&gt;. Si además, como bastante habitual, pensamos incluir herramientas de paginación, tendremos que incluir también un contenedor para la misma:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;table&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;list&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;table&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;pager&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;    &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;El siguiente paso es inicializar jqGrid cuando se termine de cargar la página, para lo que crearemos un código javascript como el mostrado a continuación, en el que se invoca la función de activación del plugin sobre la tabla cuyo ID se indica en el selector (“&lt;code&gt;#list&lt;/code&gt;“), y especificando el comportamiento deseado en los parámetros que le siguen:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;script type=&amp;quot;text/javascript&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    jQuery(document).ready(function() {&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        jQuery(&amp;quot;#list&amp;quot;).jqGrid({&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            url: '&lt;span style="background-color: #ffff00"&gt;&amp;lt;%&lt;/span&gt;= Url.Action(&lt;span style="color: #006080"&gt;&amp;quot;ObtenerDatosGrid&amp;quot;&lt;/span&gt;) &lt;!--CRLF--&gt;&lt;span style="background-color: #ffff00"&gt;%&amp;gt;&lt;/span&gt;',&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            datatype: 'json',&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            mtype: 'GET',&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            colNames: ['Apellidos', 'Nombre', 'Fecha Nac.', 'Email'],&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            colModel: [&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;              { index: 'Apellidos', width: 150, align: 'left' },&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;              { index: 'Nombre', width: 150, align: 'left', sortable: false },&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;              { index: 'FechaDeNacimiento', width: 80, align: 'center' },&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;              { index: &amp;quot;Email&amp;quot;, width: 120, align: 'left'}],&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            pager: jQuery('#pager'),&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            rowNum: 20,&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            rowList: [20, 50, 100],&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            sortname: 'Apellidos',&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            sortorder: 'asc',&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            viewrecords: true,&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            imgpath: '/content/cupertino/images',&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            caption: 'Agenda personal',&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            height: 400,&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            width: 900,&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            onSelectRow: function(id) {&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                alert(&amp;quot;Pulsado Id: &amp;quot; + id);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            }&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        });&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }); &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;    &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Revisamos rápidamente el significado de los distintos parámetros:&lt;/p&gt;&lt;ul&gt;  &lt;li&gt;&lt;code&gt;url&lt;/code&gt;, la dirección de la acción que suministrará los datos. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;datatype&lt;/code&gt;, que indica el formato de intercambio de datos. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;mtype&lt;/code&gt; , el verbo HTTP (get o post) que se utilizará para las peticiones. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;&lt;code&gt;&lt;code&gt;colnames&lt;/code&gt;&lt;/code&gt;&lt;/code&gt;, un array con los títulos de las columnas. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;colmodel&lt;/code&gt;, un array en el que cada elemento es un objeto que define     &lt;ul&gt;      &lt;li&gt;&lt;code&gt;index&lt;/code&gt;: el nombre del campo que recibiremos en el método de acción indicando la ordenación actual. &lt;/li&gt;      &lt;li&gt;&lt;code&gt;width&lt;/code&gt;: el ancho, en píxeles. &lt;/li&gt;      &lt;li&gt;&lt;code&gt;align&lt;/code&gt;: alineación de la columna. &lt;/li&gt;      &lt;li&gt;&lt;code&gt;sortable&lt;/code&gt;: si la columna se puede utilizar como criterio de ordenación. &lt;/li&gt;    &lt;/ul&gt;  &lt;/li&gt;  &lt;li&gt;&lt;code&gt;pager&lt;/code&gt;, el elemento sobre el que se compondrá la herramienta de paginación. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;rownum&lt;/code&gt;, número de elementos por página. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;rowlist&lt;/code&gt;, elementos por página mostrados en un desplegable para que el usuario lo ajuste. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;sortname&lt;/code&gt;, el campo de ordenación por defecto. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;sortorder&lt;/code&gt;, si la ordenación por defecto es ascendente o descendente. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;viewrecords&lt;/code&gt;, si se muestra el total de registros en la herramienta de paginación. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;imgpath&lt;/code&gt; , ruta hacia la carpeta de imágenes del tema elegido. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;caption&lt;/code&gt;, el título del grid. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;height&lt;/code&gt;, &lt;code&gt;width&lt;/code&gt;, alto y ancho del grid, en píxeles. &lt;/li&gt;  &lt;li&gt;&lt;code&gt;onSelectRow&lt;/code&gt;, función anónima ejecutada cuando el usuario selecciona una fila. Recibe como parámetro el identificador único del registro. &lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Y… ¡Voilá!&lt;/h3&gt;&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 5px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Demo de jqGrid en acción" border="0" alt="Demo de jqGrid en acción" align="right" src="http://lh3.ggpht.com/_O9D62hXq-ng/SuL1NzcdCYI/AAAAAAAABIg/t9xDHnhqDO8/image%5B9%5D.png?imgmax=800" width="406" height="350" /&gt;¡Hasta aquí hemos llegado! Hemos visto cómo utilizar el magnífico jqGrid en un escenario simple, paso a paso, comenzando por la descarga de los componentes, preparando el proyecto para poder utilizarlos y, finalmente, implementando el modelo, el controlador, y la vista.&lt;/p&gt;&lt;p&gt;Pero jqGrid no es sólo eso, ni mucho menos. No hemos visto más que la punta del iceberg: el plugin permite realizar búsquedas, edición, anidación de grids, árboles, escenarios maestro-detalle… en fin, una maravilla.&lt;/p&gt;&lt;p&gt;jqGrid se distribuye bajo licencia dual GPL y MIT, y puede ser utilizado tanto en proyectos comerciales como libres. Dispone de una &lt;a title="Documentación jqGrid" href="http://www.secondpersonplural.ca/jqgriddocs/index.htm" hreflang="en"&gt;documentación&lt;/a&gt;&lt;a title="Documentación jqGrid" href="http://www.secondpersonplural.ca/jqgriddocs/index.htm"&gt;&lt;/a&gt;&lt;a title="Documentación de jqGrid" href="http://www.trirand.com/jqgridwiki/"&gt;&lt;/a&gt; bastante razonable, y &lt;a title="Ejemplos de jqGrid" href="http://trirand.com/jqgrid/jqgrid.html"&gt;muchos ejemplos&lt;/a&gt; para que podamos apreciar sus virtudes.&lt;/p&gt;&lt;p&gt;Descargar proyecto de demostración:&lt;/p&gt;&lt;iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; width: 98px; padding-right: 0px; height: 115px; padding-top: 0px" title="Preview" marginheight="0" src="http://cid-c3a43a99b617d787.skydrive.live.com/embedicon.aspx/P%c3%bablico/variablenotfound.com/ASP.NET%20MVC/ASP.NET%20MVC%201.0/Demo%20jqGrid/jqGridMVC.zip" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-1612222488253071564?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Onpw42E4X1DDp98ZoW3l96160Do/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Onpw42E4X1DDp98ZoW3l96160Do/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Onpw42E4X1DDp98ZoW3l96160Do/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Onpw42E4X1DDp98ZoW3l96160Do/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=8z9yeE7jwrk:4zNJJZn_Ejg:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=8z9yeE7jwrk:4zNJJZn_Ejg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=8z9yeE7jwrk:4zNJJZn_Ejg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=8z9yeE7jwrk:4zNJJZn_Ejg:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=8z9yeE7jwrk:4zNJJZn_Ejg:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=8z9yeE7jwrk:4zNJJZn_Ejg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=8z9yeE7jwrk:4zNJJZn_Ejg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=8z9yeE7jwrk:4zNJJZn_Ejg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=8z9yeE7jwrk:4zNJJZn_Ejg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/8z9yeE7jwrk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/1612222488253071564/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=1612222488253071564" title="9 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/1612222488253071564?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/1612222488253071564?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/8z9yeE7jwrk/jqgrid-grids-espectaculares-para-aspnet.html" title="jqGrid: Grids espectaculares para ASP.NET MVC, paso a paso" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">9</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/10/jqgrid-grids-espectaculares-para-aspnet.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIMQX05fip7ImA9WxNWGUQ.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-2067150355761666300</id><published>2009-10-20T01:23:00.001+02:00</published><updated>2009-10-20T01:23:00.326+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-20T01:23:00.326+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="software" /><category scheme="http://www.blogger.com/atom/ns#" term="frikadas" /><category scheme="http://www.blogger.com/atom/ns#" term="cultura" /><title>Ilities</title><content type="html">&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 5px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="El listo" border="0" alt="El listo" align="right" src="http://lh5.ggpht.com/_O9D62hXq-ng/SsD9ZBa0-FI/AAAAAAAABH0/BpLz3jB1h98/image%5B8%5D.png?imgmax=800" width="117" height="159" /&gt; Los “ilities”, cuya traducción a nuestro idioma podría ser algo así como “ilidades”, son atributos que definen aspectos no funcionales y normalmente asociados con requisitos técnicos y cualidades de un sistema o componente software. El nombre viene del sufijo &lt;em&gt;–ilidad, &lt;/em&gt;que, como podréis ver a continuación, es común a la práctica totalidad de ellos.&lt;/p&gt;  &lt;p&gt;He encontrado en la &lt;a title="List of System Quality Attributes" href="http://en.wikipedia.org/wiki/List_of_system_quality_attributes"&gt;Wikipedia&lt;/a&gt; una interesante (aunque no exhaustiva) relación ilidades, que podemos utilizar a la hora de intentar transmitir las características de un sistema… o simplemente para aparentar ser auténticos expertos en una reunión de trabajo ;-)&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;strong&gt;Accesibilidad&lt;/strong&gt;, es decir, el hecho ser accesible a muchas personas, con independencia de sus características, dispositivos utilizados, etc. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Reportabilidad&lt;/strong&gt;, capacidad para monitorizar y registrar las acciones del usuario. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Exactitud&lt;/strong&gt;, grado de distancia desde los resultados ofrecidos por un sistema a los valores entendidos como reales. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Adaptabilidad&lt;/strong&gt;, facilidad que presenta un software para ser adaptado a necesidades concretas. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Administrabilidad&lt;/strong&gt;, indica la capacidad de un sistema o componente para ser administrado y gestionado. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Asequibilidad&lt;/strong&gt;, que indica que, atendiendo a su coste, el sistema puede ser adquirido o conseguido por los clientes. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Auditabilidad&lt;/strong&gt;, transparencia frente a sistemas de auditoría. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Disponibilidad&lt;/strong&gt;, grado en el que un sistema está disponible, operativo y funcional. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Credibilidad&lt;/strong&gt;, que es considerado subjetiva y objetivamente como una fuente de información fiable. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Conformidad con estándares&lt;/strong&gt;, grado de cercanía a las prácticas o técnicas aceptadas como estándares. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Compatibilidad&lt;/strong&gt;, que funciona en un escenario determinado, o permite sustituir otros sistemas equivalentes. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Componibilidad&lt;/strong&gt;, capacidad para combinar el software con otros elementos para componer sistemas no previstos inicialmente. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Configurabilidad&lt;/strong&gt;, esto es, que dispone de mecanismos que permiten configurar algunos aspectos de su comportamiento. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Corrección&lt;/strong&gt;, que indica que el software actúa conforme a sus especificaciones. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Personalizabilidad&lt;/strong&gt;, capacidad de un sistema para ser personalizado a las preferencias de sus usuarios. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Degradabilidad&lt;/strong&gt;, capacidad para mantener las funcionalidades básicas en condiciones adversas. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Demostrabilidad&lt;/strong&gt;, aplicable a aquellos sistemas cuyo funcionamiento puede ser demostrado. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Dependabilidad&lt;/strong&gt;, que define la probabilidad de que el sistema complete su misión, dado que estaba disponible en el comienzo de la misma. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Desplegabilidad&lt;/strong&gt;, capacidad de un software para ser desplegado en un escenario. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Distribuibilidad&lt;/strong&gt;, capacidad o facilidad de un componente o sistema para ser distribuido.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Durabilidad&lt;/strong&gt;, mantenimiento de las funciones con el paso del tiempo.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Efectividad&lt;/strong&gt;, o capacidad para lograr el efecto deseado.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Eficiencia&lt;/strong&gt;, capacidad para lograr el efecto deseado con el menor consumo posible de recursos.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Evolucionabilidad&lt;/strong&gt;, grado de facilidad con la que es posible hacer evolucionar un sistema para adaptarse a nuevas condiciones.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Extensibilidad&lt;/strong&gt;, capacidad de un software para ser ampliado con nuevas funciones sin modificar su estructura básica.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Fidelidad&lt;/strong&gt;, que ofrece precisión y confianza en la representación de la realidad.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Flexibilidad&lt;/strong&gt;, que puede adaptarse con facilidad a cambios en el entorno.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Instalabilidad&lt;/strong&gt;, facilidad para ser instalado en un entorno&amp;#160; determinado.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Integridad&lt;/strong&gt;, capacidad para evitar y sobreponerse a errores en la información que maneja.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Intercambiabilidad&lt;/strong&gt;, que indica que un componente puede ser sustituido por otro sin modificar aquellos que lo utilizan.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Interoperabilidad&lt;/strong&gt;, capacidad que tiene un sistema para intercambiar información con otro.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Aprendibilidad&lt;/strong&gt;, es decir, la capacidad que presenta un software para enseñar su propio manejo al usuario.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Mantenibilidad&lt;/strong&gt;, o facilidad con la que se puede corregir, modificar o ampliar un software.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Gestionabilidad&lt;/strong&gt;, facilidad para gestionar la complejidad de un sistema.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Movilidad&lt;/strong&gt;, posibilidad que tiene un sistema de funcionar en distintas ubicaciones geográficas.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Modularidad&lt;/strong&gt;, grado en el que un software está internamente dividido en bloques independientes.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Nomadicidad&lt;/strong&gt;, capacidad de un sistema para adaptarse de forma transparente a una situación de desconexión por cambio de ubicación-&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Operabilidad&lt;/strong&gt;, capacidad de un software para funcionar y cumplir su misión.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Portabilidad&lt;/strong&gt;, la facilidad con la que un software puede ser transferido a otro entorno software o hardware.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Precisión&lt;/strong&gt;, nivel de detalle con el que un sistema es capaz de manejar información.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Predictibilidad&lt;/strong&gt;, grado de certeza del comportamiento del sistema ante un escenario determinado.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Recuperabilidad&lt;/strong&gt;, capacidad de un sistema de restablecer un nivel apropiado de servicio y recuperar sus datos en caso de producirse fallos.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Fiabilidad, &lt;/strong&gt;es la habilidad de un software para realizar sus funciones de forma correcta bajo unas condiciones determinadas.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Repetibilidad&lt;/strong&gt;, es la capacidad de generar el mismo resultado si no cambian las condiciones.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Reproducibilidad&lt;/strong&gt;, es el grado de precisión que se obtiene al intentar reproducir un comportamiento del sistema.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Responsividad, &lt;/strong&gt;velocidad con la que un sistema realiza una tarea, por ejemplo responder a la entrada del usuario.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Reusabilidad&lt;/strong&gt;, facilidad con la que un componente o sistema puede ser reutilizado para añadir funcionalidades o características en un nuevo sistema.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Robustez&lt;/strong&gt;, capacidad para continuar la operación aún en el caso de producirse errores inesperados.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Seguridad&lt;/strong&gt;, capacidad de un software para conseguir niveles aceptables de daños a personas, negocios, software, propiedades o entorno.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Escalabilidad&lt;/strong&gt;, facilidad con la que un sistema puede ser adaptado para satisfacer necesidades mayores de carga de trabajo.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Uniformidad&lt;/strong&gt;, grado de presentación como una estructura consistente, aunque el sistema incluya diversas tecnologías.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Soportabilidad&lt;/strong&gt;, que hace referencia a la habilidad del soporte técnico para dar soporte a los productos.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Asegurabilidad&lt;/strong&gt;, capacidad para asegurar distintos niveles de un sistema.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Simplicidad&lt;/strong&gt;, o ausencia de complicaciones y dificultades.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Estabilidad&lt;/strong&gt;, capacidad de un software para funcionar períodos del tiempo sin parar o funcionar incorrectamente.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Comprobabilidad&lt;/strong&gt;, el grado en el que un componente soporta la realización de pruebas para validar su corrección.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Oportunidad&lt;/strong&gt;, es decir, el hecho de estar disponible en el momento en el que debe estarlo.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Ubicuidad&lt;/strong&gt;, capacidad de un software para estar presente en todas partes, en cualquier momento.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Comprensibilidad&lt;/strong&gt;, facilidad con la que un software puede ser comprendido a los distintos niveles.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Usabilidad&lt;/strong&gt;, facilidad con la que un usuario puede utilizar un sistema software para conseguir un objetivo.&lt;strong&gt;&amp;#160;&lt;/strong&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Los términos originales estaban en inglés y algunos no eran fácilmente traducibles, así que en más de una ocasión he tenido que echar mano de la creatividad y patear a la RAE y todos sus integrantes ;-D&lt;/p&gt;  &lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-2067150355761666300?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4UUsH_C_aWA9BVBQZO00vSZZJZ0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4UUsH_C_aWA9BVBQZO00vSZZJZ0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4UUsH_C_aWA9BVBQZO00vSZZJZ0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4UUsH_C_aWA9BVBQZO00vSZZJZ0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=XSAAh92J1Yo:qdsS27jeem0:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=XSAAh92J1Yo:qdsS27jeem0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=XSAAh92J1Yo:qdsS27jeem0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=XSAAh92J1Yo:qdsS27jeem0:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=XSAAh92J1Yo:qdsS27jeem0:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=XSAAh92J1Yo:qdsS27jeem0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=XSAAh92J1Yo:qdsS27jeem0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=XSAAh92J1Yo:qdsS27jeem0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=XSAAh92J1Yo:qdsS27jeem0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/XSAAh92J1Yo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/2067150355761666300/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=2067150355761666300" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/2067150355761666300?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/2067150355761666300?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/XSAAh92J1Yo/ilities.html" title="Ilities" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/10/ilities.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0EDQns6eCp7ImA9WxNWFUQ.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-1511526303900557184</id><published>2009-10-14T13:00:00.001+02:00</published><updated>2009-10-15T09:27:53.510+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T09:27:53.510+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="google" /><category scheme="http://www.blogger.com/atom/ns#" term="servicios on-line" /><title>En la onda, con Google Wave</title><content type="html">&lt;p&gt;No recuerdo cuándo exactamente, debió ser cuando estuve comentando la presentación de esa misteriosa criatura llamada &lt;a title="Sintoniza la onda de Google" href="http://www.variablenotfound.com/2009/05/sintoniza-la-onda-de-google.html"&gt;Google Wave&lt;/a&gt;, pero al parecer solicité una invitación para probar el producto, y hoy me ha llegado.&lt;/p&gt;  &lt;p&gt;Tras seguir el enlace recibido por email, he instalado &lt;a title="Chrome Frame" href="http://code.google.com/intl/es/chrome/chromeframe/"&gt;Chrome Frame&lt;/a&gt;, el complemento para Internet Explorer que permite incrustar el navegador Chrome, y ya se puede decir que estoy en la onda ;-)&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px auto 5px; display: block; float: none; border-top: 0px; border-right: 0px" title="Google Wave en acción" border="0" alt="Google Wave en acción" src="http://lh3.ggpht.com/_O9D62hXq-ng/StWGiORNV4I/AAAAAAAABIU/yQ_6gRwDWho/image%5B9%5D.png?imgmax=800" width="539" height="425" /&gt; &lt;/p&gt;  &lt;p&gt;A ver si un día de estos tengo un rato libre para probarlo en profundidad, por que la verdad es que tengo ganas de comprobar de primera mano si el revuelo que ha levantado Wave en la red está fundado o no. Seguiremos informando al respecto. :-)&lt;/p&gt;  &lt;p&gt;Por cierto, &lt;strong&gt;tengo ocho invitaciones &lt;/strong&gt;para otros tantos amigos que quieran probarlo, sólo tenéis que hacerme llegar vuestra dirección de correo electrónico e iré enviando las invitaciones en riguroso orden de llegada.&lt;/p&gt;  &lt;p&gt;Uf, ya sólo tengo siete, vais a tener que daros prisa…&lt;/p&gt;  &lt;br /&gt;&lt;div style="background-color: yellow; padding: 5; border: 1px solid black; color: black;"&gt;Actualizado (15-oct): ya he informado a los afortunados por email, y enviado sus datos a Google Wave, sólo les queda esperar a que les lleguen las invitaciones. Gracias a todos por participar.&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-1511526303900557184?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XwU2_2Xuw4PxrWjmDdvbK5b9LzY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XwU2_2Xuw4PxrWjmDdvbK5b9LzY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XwU2_2Xuw4PxrWjmDdvbK5b9LzY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XwU2_2Xuw4PxrWjmDdvbK5b9LzY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=K6GpkNhrxAY:RcBH3YsZEo8:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=K6GpkNhrxAY:RcBH3YsZEo8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=K6GpkNhrxAY:RcBH3YsZEo8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=K6GpkNhrxAY:RcBH3YsZEo8:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=K6GpkNhrxAY:RcBH3YsZEo8:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=K6GpkNhrxAY:RcBH3YsZEo8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=K6GpkNhrxAY:RcBH3YsZEo8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=K6GpkNhrxAY:RcBH3YsZEo8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=K6GpkNhrxAY:RcBH3YsZEo8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/K6GpkNhrxAY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/1511526303900557184/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=1511526303900557184" title="22 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/1511526303900557184?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/1511526303900557184?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/K6GpkNhrxAY/en-la-onda-con-google-wave.html" title="En la onda, con Google Wave" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">22</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/10/en-la-onda-con-google-wave.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEMQX08eip7ImA9WxNWE0U.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-2435407440805822896</id><published>2009-10-12T23:58:00.002+02:00</published><updated>2009-10-12T23:58:00.372+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-12T23:58:00.372+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="frameworks" /><category scheme="http://www.blogger.com/atom/ns#" term="jquery" /><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><category scheme="http://www.blogger.com/atom/ns#" term="aspnetmvc" /><category scheme="http://www.blogger.com/atom/ns#" term="xVal" /><category scheme="http://www.blogger.com/atom/ns#" term="programación" /><title>xVal, validaciones automáticas para ASP.NET MVC</title><content type="html">&lt;p&gt;Mientras esperamos impacientes la llegada de ASP.NET MVC 2 con su flamante sistema integrado de validación de datos en cliente y servidor, &lt;a title="xVal en CodePlex" href="http://www.codeplex.com/xval"&gt;xVal&lt;/a&gt; puede sernos de bastante utilidad al ofrecernos prácticamente las mismas funciones previstas para la versión 2, y alguna más :-)&lt;/p&gt;&lt;p&gt;xVal es un framework para aplicaciones ASP.NET MVC 1.0 (y superiores) creado por &lt;a title="Steve Sanderson" href="http://blog.codeville.net/about/" hreflang="en"&gt;Steve Sanderson&lt;/a&gt;&lt;a title="Steve Sanderson" href="http://blog.codeville.net/about/"&gt;&lt;/a&gt;, y &lt;a title="xVal 1.0 now available" href="http://blog.codeville.net/2009/09/17/xval-v10-now-available/"&gt;presentado en sociedad&lt;/a&gt; el pasado 17 de septiembre, que permite validar la información almacenada en clases del modelo, tanto en el lado cliente como en servidor, de forma automatizada.&lt;/p&gt;  &lt;p&gt;Su diseño es muy flexible, permitiéndonos elegir entre distintos marcos de trabajo para la validación en servidor (de serie soporta los atributos &lt;a title="System.ComponentModel.DataAnnotations" href="http://msdn.microsoft.com/es-es/library/system.componentmodel.dataannotations.aspx"&gt;DataAnnotations&lt;/a&gt;, &lt;a title="Castle Validators" href="http://www.castleproject.org/ActiveRecord/documentation/v1rc1/manual/validators.html"&gt;Castle Validator&lt;/a&gt; y &lt;a title="NHibernate Validator" href="https://www.hibernate.org/22.html"&gt;NHibernate Validator&lt;/a&gt;, aunque se pueden crear proveedores personalizados) y librerías en cliente (inicialmente utiliza el magnífico plugin &lt;a title="jQuery Validation" href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/"&gt;jQuery Validation&lt;/a&gt;).&lt;/p&gt;  &lt;p&gt;&lt;img style="display: block; float: none; margin-left: auto; margin-right: auto" src="http://blog.codeville.net/wp-content/uploads/2009/01/image-thumb.png" width="452" height="173" /&gt;&lt;/p&gt;  &lt;p&gt;Vamos a ver, paso a paso, cómo podemos comenzar a utilizarlo de forma inmediata en nuestras aplicaciones ASP.NET MVC 1.0, utilizando las restricciones &lt;a title="System.ComponentModel.DataAnnotations" href="http://msdn.microsoft.com/es-es/library/system.componentmodel.dataannotations.aspx"&gt;DataAnnotations&lt;/a&gt; y la librería de validación para &lt;a title="jQuery" href="http://jquery.com/"&gt;jQuery&lt;/a&gt; citada anteriormente.&lt;/p&gt;  &lt;h3&gt;1. Preparamos la infraestructura&lt;/h3&gt;  &lt;p&gt;En primer lugar, vamos a preparar el entorno para utilizar el framework de validación:&lt;/p&gt;  &lt;ol&gt;   &lt;br /&gt;&lt;li&gt;Descargamos xVal desde &lt;a title="Descargar xVal" href="http://xval.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33155"&gt;CodePlex&lt;/a&gt;. Se distribuye en un fichero .zip que incluye tanto el ensamblado como archivos de soporte, así que lo descomprimimos en cualquier parte para tener los archivos a mano.       &lt;br /&gt;&lt;/li&gt;    &lt;br /&gt;&lt;li&gt;Descargamos el &lt;a title="jQuery validation" href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/"&gt;plugin de validación de jQuery&lt;/a&gt;, por ejemplo, &lt;a title="Descargar jquery.validate.js" href="http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate.min.js"&gt;desde el CDN de Microsoft&lt;/a&gt; (¿qué es el &lt;a title="Microsoft Ajax CDN" href="http://www.variablenotfound.com/2009/09/mas-javascript-en-la-red-microsoft-ajax.html"&gt;Microsoft Ajax CDN&lt;/a&gt;?) y lo incluimos en la carpeta &lt;code&gt;/scripts &lt;/code&gt;de nuestro proyecto. Otra posibilidad sería no descargarlo y referenciarlo directamente nuestras páginas, a gusto del consumidor ;-)       &lt;br /&gt;&lt;/li&gt;    &lt;br /&gt;&lt;li&gt;Añadimos a la carpeta &lt;code&gt;/scripts&lt;/code&gt; del proyecto la librería &lt;code&gt;xVal.jQuery.Validate.js&lt;/code&gt; presente en el raíz del comprimido de xVal. Este archivo, junto con el anterior, son imprescindibles para montar la validación automática en el lado cliente que veremos más adelante. Además, para que los mensajes aparezcan en nuestro idioma, copiamos también al mismo sitio el archivo &lt;code&gt;xVal.Messages.es-ES.js&lt;/code&gt;, disponible en la carpeta “internationalization” del zip.       &lt;br /&gt;&lt;/li&gt;    &lt;br /&gt;&lt;li&gt;Copiamos al directorio &lt;code&gt;/bin &lt;/code&gt;de nuestra aplicación el ensamblado &lt;code&gt;xVal.dll&lt;/code&gt;, o simplemente añadimos una referencia en el proyecto hacia dicho archivo, que encontraréis en el raíz del fichero comprimido que hemos descargado en primer lugar.       &lt;br /&gt;&lt;/li&gt;    &lt;br /&gt;&lt;li&gt;Retocamos ligeramente el Web.config de nuestro proyecto para que sea incluido automáticamente el espacio de nombres &lt;code&gt;xVal.Html&lt;/code&gt; en nuestras vistas, facilitando así el acceso a los helpers suministrados:       &lt;br /&gt;      &lt;br /&gt;      &lt;div id="codeSnippetWrapper"&gt;       &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;         &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;system.web&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;pages&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;namespaces&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #008000"&gt;&amp;lt;!-- Añadir la siguiente línea --&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;namespace&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;xVal.Html&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;namespaces&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;pages&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;system.web&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;    &lt;/div&gt;  &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Los pasos comentados hasta el momento son genéricos, es decir, tendremos que realizarlos en todos los proyectos en los que vayamos a utilizar este framework de validación. Podría ser interesante, por tanto, crearnos una plantilla de proyecto en la que tengamos ya todo este trabajo realizado.&lt;/p&gt;&lt;h3&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Diálogo " border="0" alt="Diálogo " align="right" src="http://lh3.ggpht.com/_O9D62hXq-ng/StN9ww-kxKI/AAAAAAAABIQ/rGgjbDS6U7Y/image%5B8%5D.png?imgmax=800" width="278" height="212" referencia??="referencia??" agregar="agregar" /&gt;2. Definimos las restricciones con &lt;em&gt;Data Annotations&lt;/em&gt;&lt;/h3&gt;&lt;p&gt;Ahora vamos a definir, de forma declarativa, las restricciones que queremos imponer a las propiedades de las clases del modelo, utilizando los atributos denominado &lt;em&gt;data annotations&lt;/em&gt;, distribuidos con .NET 3.5 y originalmente diseñados para trabajar con la tecnología &lt;em&gt;Dynamic Data&lt;/em&gt;.&lt;/p&gt;&lt;ol&gt;  &lt;br /&gt;&lt;li&gt;Dado que vamos a declarar las restricciones utilizando los atributos &lt;em&gt;data annotations, &lt;/em&gt;hay que añadir referencia en el proyecto a&amp;#160; &lt;code&gt;System.ComponentModel.DataAnnotations.       &lt;br /&gt;&lt;/code&gt;&lt;/li&gt;  &lt;br /&gt;&lt;li&gt;A continuación, tenemos que incluir en el proyecto un método que nos permita recorrer las anotaciones de las clases, ejecutarlas e ir generando los errores apropiadamente.&amp;#160; Este método lo utilizaremos más adelante, desde los componentes del Modelo, para comprobar si los valores presentes en las propiedades cumplen los requisitos impuestos por el dominio del sistema.     &lt;br /&gt;    &lt;br /&gt;El código es muy sencillo, el propio Sanderson nos facilita uno en el &lt;a title="Demo de xVal 1.0" href="http://blog.codeville.net/blogfiles/2009/September/BookingsDemo-1.0.zip"&gt;proyecto de demostración de xVal&lt;/a&gt;, que podéis copiar y pegar:     &lt;br /&gt;    &lt;br /&gt;    &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web;&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; xVal.ServerSide;&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.ComponentModel.DataAnnotations;&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.ComponentModel;&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; MyProject.Validation&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; DataAnnotationsValidationRunner&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; IEnumerable&amp;lt;ErrorInfo&amp;gt; GetErrors(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; instance)&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  {&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    var metadataAttrib = instance.GetType()&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                            .GetCustomAttributes(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(MetadataTypeAttribute), &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                            .OfType&amp;lt;MetadataTypeAttribute&amp;gt;().FirstOrDefault();&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    var buddyClassOrModelClass = metadataAttrib != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; ? &lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                                    metadataAttrib.MetadataClassType:&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                                    instance.GetType();&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    var buddyClassProperties = TypeDescriptor.GetProperties(buddyClassOrModelClass)&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                            .Cast&amp;lt;PropertyDescriptor&amp;gt;();&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    var modelClassProperties = TypeDescriptor.GetProperties(instance.GetType())&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                            .Cast&amp;lt;PropertyDescriptor&amp;gt;();&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; from buddyProp &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; buddyClassProperties&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;               join modelProp &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; modelClassProperties on buddyProp.Name equals modelProp.Name&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;               from attribute &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; buddyProp.Attributes.OfType&amp;lt;ValidationAttribute&amp;gt;()&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;               &lt;span style="color: #0000ff"&gt;where&lt;/span&gt; !attribute.IsValid(modelProp.GetValue(instance))&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;               select &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ErrorInfo(&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                            buddyProp.Name, &lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                            attribute.FormatErrorMessage(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Empty), instance);&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  }&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;    &lt;br /&gt;Ojo, esto sólo tenemos que hacerlo cuando estemos utilizando DataAnnotations, como es el caso; si utilizamos otros frameworks como el de Castle o NHibernate no será necesario, puesto que incluyen ya implementaciones para realizar esta tarea.     &lt;br /&gt;    &lt;br /&gt;&lt;/li&gt;  &lt;br /&gt;&lt;li&gt;Marcamos las propiedades de la entidad del modelo con las restricciones a aplicar durante la validación. Podemos utilizar los atributos disponibles para restringir los valores permitidos en cada propiedad como &lt;code&gt;Required&lt;/code&gt; , &lt;code&gt;StringLength&lt;/code&gt; , &lt;code&gt;Range&lt;/code&gt;&amp;#160; y otros (puedes &lt;a title="DataAnnotations en MSDN" href="http://msdn.microsoft.com/es-es/library/system.componentmodel.dataannotations.aspx"&gt;ver la relación completa aquí&lt;/a&gt;).     &lt;br /&gt;    &lt;br /&gt;Un ejemplo podría ser el siguiente, en el que vemos varias restricciones aplicadas a las propiedades de la entidad:     &lt;br /&gt;    &lt;br /&gt;    &lt;div id="codeSnippetWrapper"&gt;      &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Recluta&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [Required, StringLength(30)]&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Nombre { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [Required, StringLength(40)]&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Apellidos { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [Required, Range(1, 4)]&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Talla { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [Required, DataType(DataType.Date)]&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; DateTime FechaNacimiento { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;    &lt;/div&gt;    &lt;div&gt;      &lt;br /&gt;Sin embargo, muchos os preguntaréis qué ocurre cuando estas entidades de datos las generamos con herramientas automáticas, como el diseñador de Entity Framework. En estos casos, cada vez que generemos el modelo, las clases serían machacadas por las nuevas versiones, y nuestras anotaciones pasarían a mejor vida.       &lt;br /&gt;      &lt;br /&gt;Afortunadamente, existe la posibilidad de declarar una clase paralela (o, como la llaman, ‘buddy class’), en la que definiremos exclusivamente las propiedades a las que queremos añadir alguna anotación. Además, marcaremos la entidad original (aprovechando que la mayoría de estas herramientas automáticas las generan como parciales) indicando la clase que contiene los metadatos asociados a ésta:       &lt;br /&gt;      &lt;br /&gt;&lt;/div&gt;    &lt;div id="codeSnippetWrapper"&gt;      &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;// Indicamos en la entidad original que los&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;// metadatos se encuentran en 'ReclutaMedata'&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;[MetadataType(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(ReclutaMetadata))]&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;partial&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Recluta&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{ &lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;// Nada más que añadir aquí&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;// Definimos los metadatos para la entidad 'Recluta'&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; ReclutaMetadata&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [Required, StringLength(30)]&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Nombre { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [Required, StringLength(40)]&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Apellidos { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [Required, Range(1, 4)]&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Talla { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [Required, DataType(DataType.Date)]&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; DateTime FechaNacimiento { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;    &lt;/div&gt;    &lt;div id="codeSnippetWrapper"&gt;&lt;/div&gt;    &lt;div id="codeSnippetWrapper"&gt;&lt;/div&gt;    &lt;div&gt;      &lt;br /&gt;Como podéis observar, la entidad y la clase de metadatos son prácticamente iguales. Un poco anti-&lt;a title="¡No te repitas!" href="http://es.wikipedia.org/wiki/No_te_repitas"&gt;DRY&lt;/a&gt; sí que es, pero bueno.&lt;/div&gt;  &lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;3. Validamos en servidor&lt;/h3&gt;&lt;p&gt;La propuesta de xVal para el lado del servidor consiste en desplazar la lógica de validación al modelo, dado que es éste el que normalmente impone las restricciones en los datos que han de estar presentes en las entidades del dominio. Una forma de realizarlo sería así:&lt;/p&gt;&lt;ul&gt;  &lt;li&gt;por cada entidad, creamos un método que valide la información del mismo, primero invocando al &lt;em&gt;ValidationRunner&lt;/em&gt; (el proceso de validación basado en anotaciones descrito anteriormente), y luego añadiendo aquellas reglas de negocio no incluidas en dichas anotaciones). Un ejemplo podría ser el siguiente:     &lt;br /&gt;    &lt;br /&gt;    &lt;div&gt;      &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; validar(Recluta recluta)&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    var errors = DataAnnotationsValidationRunner.GetErrors(recluta);&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (errors.Any())&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RulesException(errors);&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;// Regla de negocio adicional: prohibido alistarse reclutas&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;// con hermanos en el cuartel...&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (tieneHermanos(recluta.Apellidos))&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RulesException(&lt;span style="color: #006080"&gt;&amp;quot;Apellidos&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                    &lt;span style="color: #006080"&gt;&amp;quot;El recluta tiene hermanos ya alistados&amp;quot;&lt;/span&gt;, recluta);&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;    &lt;/div&gt;    &lt;div&gt;&amp;#160;&lt;/div&gt;    &lt;div&gt;Este método podría incluirse en la propia entidad &lt;code&gt;Recluta&lt;/code&gt;, o bien donde se implemente la lógica de negocio asociada a la misma.&lt;/div&gt;    &lt;div&gt;&amp;#160;&lt;/div&gt;    &lt;div&gt;En cualquier caso, como se puede observar, cuando se producen errores debido a un incumplimiento de las restricciones indicadas en las anotaciones, se lanza una excepción de tipo &lt;code&gt;RulesException&lt;/code&gt; (facilitada por xVal) que contiene una descripción de los problemas encontrados. Asimismo, la existencia de otro tipo de problemas, hallados de forma programática, son lanzados también en una excepción del mismo tipo.&lt;/div&gt;    &lt;div&gt;&amp;#160;&lt;/div&gt;  &lt;/li&gt;  &lt;br /&gt;&lt;li&gt;antes de realizar operaciones susceptibles de modificar el estado del sistema, tenemos que asegurarnos de que las entidades son válidas. Observad, por ejemplo, la implementación del método que nos permite añadir un recluta al sistema:     &lt;br /&gt;    &lt;br /&gt;    &lt;div id="codeSnippetWrapper"&gt;      &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Crear(Recluta recluta)&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    validar(recluta);&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    reclutas.Add(recluta);&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;      &lt;br /&gt;Si se producen errores en la validación, el método &lt;code&gt;Crear()&lt;/code&gt; será interrumpido por la excepción &lt;code&gt;RulesException&lt;/code&gt; lanzada desde &lt;code&gt;validar()&lt;/code&gt;, y llegará finalmente hasta el Controlador, donde deberá ser procesada.&amp;#160; &lt;br /&gt;&lt;/div&gt;  &lt;/li&gt;  &lt;br /&gt;&lt;li&gt;desde el punto de vista del Controlador, podremos comprobar que el patrón a seguir es realmente sencillo, pues toda la lógica de validación la hemos desplazado al modelo.     &lt;br /&gt;    &lt;br /&gt;El siguiente código muestra los métodos de acción asociados a la creación de una entidad; el primero de ellos simplemente se encarga de mostrar la vista de edición sobre un objeto recién creado, mientras que el segundo obtiene los datos del recluta desde el formulario, e intenta realizar la operación de creación sobre el modelo:     &lt;br /&gt;    &lt;br /&gt;    &lt;div&gt;      &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ActionResult Create()&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; View(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Recluta());&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;[AcceptVerbs(HttpVerbs.Post)]&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ActionResult Create(Recluta recluta)&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        gestorDeReclutas.Crear(recluta);&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (RulesException ex)&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        ex.AddModelStateErrors(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ModelState, &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!ModelState.IsValid)&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; View(recluta);&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; RedirectToAction(&lt;span style="color: #006080"&gt;&amp;quot;Index&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;    &lt;/div&gt;    &lt;div&gt;      &lt;br /&gt;Como se puede observar, se capturan las excepciones de validación que se produzcan al realizar el alta, añadiendo al &lt;code&gt;ModelState&lt;/code&gt; los errores que se estén informando en éstas y, en función de la validez de los datos, enviando al usuario a la vista correspondiente.&lt;/div&gt;  &lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Y esto es todo. Con estas operaciones, ya tenemos las validaciones listas en el lado del servidor, pasemos ahora a solucionarlas en cliente.&lt;/div&gt;&lt;h3&gt;4. Validamos en el cliente&lt;/h3&gt;&lt;p&gt;Está claro que la validación en el lado del servidor es la que única que debemos hacer obligatoriamente; el lado cliente es sensible al equipo del usuario, que puede estar accediendo desde dispositivos sin javascript (o con esta característica desactivada), o incluso puede ser fácilmente manipulado, por lo que no podemos confiar en que los datos lleguen ya siendo válidos.&lt;/p&gt;&lt;p&gt;Sin embargo, ofrecer validación en cliente es una característica imprescindible hoy en día vistas a realizar interfaces muy usables, capaces de ofrecer al usuario feedback inmediato sobre sus acciones.&lt;/p&gt;&lt;p&gt;Con &lt;strong&gt;xVal&lt;/strong&gt;, añadir en este punto validaciones en cliente es realmente sencillo, pues ya tenemos realizado prácticamente todo el trabajo, quedando simplemente:&lt;/p&gt;&lt;ol&gt;  &lt;li&gt;incluir las librerías script en las vistas donde vayamos a realizar la edición de las entidades del modelo. Si vamos a utilizarlas en muchos sitios, lo más fácil es añadirlas a la página maestra:     &lt;br /&gt;    &lt;br /&gt;    &lt;div id="codeSnippetWrapper"&gt;      &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;lt;script src=&lt;span style="color: #006080"&gt;&amp;quot;../../Scripts/jquery-1.3.2.min.js&amp;quot;&lt;/span&gt; type=&lt;span style="color: #006080"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;lt;script src=&lt;span style="color: #006080"&gt;&amp;quot;../../Scripts/jquery.validate.min.js&amp;quot;&lt;/span&gt; type=&lt;span style="color: #006080"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;lt;script src=&lt;span style="color: #006080"&gt;&amp;quot;../../Scripts/xVal.jquery.validate.js&amp;quot;&lt;/span&gt; type=&lt;span style="color: #006080"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;lt;script src=&lt;span style="color: #006080"&gt;&amp;quot;../../Scripts/xVal.Messages.es-ES.js&amp;quot;&lt;/span&gt; type=&lt;span style="color: #006080"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;      &lt;br /&gt;&lt;/div&gt;  &lt;/li&gt;  &lt;br /&gt;&lt;li&gt;generar en la vista los scripts de validación de las entidades que nos interesen. En el siguiente código generamos la lógica para la entidad &lt;code&gt;Recluta&lt;/code&gt;:     &lt;br /&gt;&amp;#160; &lt;br /&gt;    &lt;div id="codeSnippetWrapper"&gt;      &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;        &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;lt;%= Html.ClientSideValidation&amp;lt;MiProyecto.Models.Recluta&amp;gt;() %&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/div&gt;  &lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;5. ¡Y hasta aquí hemos llegado!&lt;/h3&gt;&lt;p&gt;A lo largo de este post hemos recorrido los pasos necesarios para echar a andar el framework xVal en una aplicación ASP.NET MVC 1.0.&lt;/p&gt;&lt;p&gt;Faltan muchos aspectos por comentar, como la posibilidad de utilizar validaciones Ajax en servidor, permitir la localización en decimales, escribir nuestros propios atributos de anotaciones, etc., pero creo que este post ya es lo suficientemente extenso… ya lo veremos en otra ocasión.&lt;/p&gt;&lt;p&gt;Puedes descargar el proyecto de demostración desde Skydrive:&lt;/p&gt;&lt;p&gt;&lt;iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; width: 98px; padding-right: 0px; height: 115px; padding-top: 0px" title="Preview" marginheight="0" src="http://cid-c3a43a99b617d787.skydrive.live.com/embedicon.aspx/P%c3%bablico/variablenotfound.com/ASP.NET%20MVC/ASP.NET%20MVC%201.0/Demo%20xVal%201.0/Demo^_xVal.zip" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-2435407440805822896?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Za2FvTBes6iNkBsrt6eIQQXo7Zg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Za2FvTBes6iNkBsrt6eIQQXo7Zg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Za2FvTBes6iNkBsrt6eIQQXo7Zg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Za2FvTBes6iNkBsrt6eIQQXo7Zg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=5ETexbrfAmY:4wIUwFUi1sw:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=5ETexbrfAmY:4wIUwFUi1sw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=5ETexbrfAmY:4wIUwFUi1sw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=5ETexbrfAmY:4wIUwFUi1sw:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=5ETexbrfAmY:4wIUwFUi1sw:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=5ETexbrfAmY:4wIUwFUi1sw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=5ETexbrfAmY:4wIUwFUi1sw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=5ETexbrfAmY:4wIUwFUi1sw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=5ETexbrfAmY:4wIUwFUi1sw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/5ETexbrfAmY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/2435407440805822896/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=2435407440805822896" title="2 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/2435407440805822896?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/2435407440805822896?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/5ETexbrfAmY/xval-validaciones-automaticas-para.html" title="xVal, validaciones automáticas para ASP.NET MVC" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/10/xval-validaciones-automaticas-para.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcCQXw4eip7ImA9WxNXGU8.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-6846708768530575439</id><published>2009-10-07T17:04:00.001+02:00</published><updated>2009-10-07T17:07:40.232+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-07T17:07:40.232+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="charlas" /><category scheme="http://www.blogger.com/atom/ns#" term="aspnetmvc" /><title>Grabación y materiales de la charla sobre MVC</title><content type="html">&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 5px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Presentación ASP.NET MVC" border="0" alt="Presentación ASP.NET MVC" align="right" src="http://lh5.ggpht.com/_O9D62hXq-ng/SsyuabijtsI/AAAAAAAABIE/yDTBVe2iJb0/image%5B8%5D.png?imgmax=800" width="264" height="210" /&gt;Pues eso, que ya están disponibles para su descarga tanto la grabación del evento como los materiales utilizados durante la charla de ayer, organizada por &lt;a title="Second Nug" href="http://www.secondnug.com/Default.aspx"&gt;Second Nug&lt;/a&gt;, en la que realizamos una introducción al framework ASP.NET MVC.&lt;/p&gt;  &lt;p&gt;En los materiales se incluye tanto el PPT utilizado en la primera parte de la presentación como el código del proyecto que desarrollamos durante la segunda parte, el famoso sistema &lt;strong&gt;Aúpa!net&lt;/strong&gt; ;-), en forma de solución para Visual Web Developer Express 2008 (SP1). Recordad que para poder ejecutarlo y jugar con él necesitáis instalar previamente &lt;a title="Descargar ASP.NET MVC 1.0" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=53289097-73ce-43bf-b6a6-35e00103cb4b&amp;amp;displaylang=en"&gt;ASP.NET MVC 1.0&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Gracias a todos los que pudisteis asistir al evento en directo (y en especial, los que aguantasteis hasta el final como auténticos campeones ;-)) … bueno, y a los que asistiréis aunque sea off-line ;-P&lt;/p&gt;  &lt;p&gt;Enlaces:&lt;/p&gt;  &lt;table style="margin-left: 50px" border="0" cellspacing="0" cellpadding="2" width="433"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="middle" width="49"&gt;&lt;a title="Acceder a la grabación del evento, en alta fidelidad y WMV" href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032426662&amp;amp;Culture=es-ES"&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="" border="0" alt="" align="left" src="http://lh4.ggpht.com/_O9D62hXq-ng/Ssyuanndt7I/AAAAAAAABII/qgE9YzZSTUk/image%5B29%5D.png?imgmax=800" width="48" height="40" /&gt;&lt;/a&gt; &lt;/td&gt;        &lt;td valign="middle" width="382"&gt;         &lt;p&gt;&lt;a title="Acceder a la grabación del evento, en alta fidelidad y WMV" href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032426662&amp;amp;Culture=es-ES"&gt;Acceder a la grabación del evento&lt;/a&gt; &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="middle" width="49"&gt;&lt;a title="Descargar materiales del evento" href="http://cid-72370476216aac6e.skydrive.live.com/self.aspx/.Public/MVC/Materiales%20ASP.NET%20MVC.zip"&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="" border="0" alt="" align="left" src="http://lh5.ggpht.com/_O9D62hXq-ng/SsyubG30KWI/AAAAAAAABIM/tZl__nzzyEI/image%5B30%5D.png?imgmax=800" width="44" height="45" /&gt;&lt;/a&gt;&lt;/td&gt;        &lt;td valign="middle" width="382"&gt;&lt;a title="Descargar materiales del evento" href="http://cid-72370476216aac6e.skydrive.live.com/self.aspx/.Public/MVC/Materiales%20ASP.NET%20MVC.zip"&gt;Descarga de materiales (.zip)&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-6846708768530575439?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wtWt-927s9RPPuMNssE7A5v27UM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wtWt-927s9RPPuMNssE7A5v27UM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wtWt-927s9RPPuMNssE7A5v27UM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wtWt-927s9RPPuMNssE7A5v27UM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=eIB3c6rw6qc:XWkr3S-F9kw:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=eIB3c6rw6qc:XWkr3S-F9kw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=eIB3c6rw6qc:XWkr3S-F9kw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=eIB3c6rw6qc:XWkr3S-F9kw:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=eIB3c6rw6qc:XWkr3S-F9kw:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=eIB3c6rw6qc:XWkr3S-F9kw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=eIB3c6rw6qc:XWkr3S-F9kw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=eIB3c6rw6qc:XWkr3S-F9kw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=eIB3c6rw6qc:XWkr3S-F9kw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/eIB3c6rw6qc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/6846708768530575439/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=6846708768530575439" title="2 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/6846708768530575439?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/6846708768530575439?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/eIB3c6rw6qc/grabacion-y-materiales-de-la-charla.html" title="Grabación y materiales de la charla sobre MVC" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/10/grabacion-y-materiales-de-la-charla.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08BSH49eyp7ImA9WxNXF0k.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-5703660379937516286</id><published>2009-10-05T13:23:00.000+02:00</published><updated>2009-10-05T13:24:19.063+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-05T13:24:19.063+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="charlas" /><category scheme="http://www.blogger.com/atom/ns#" term="aspnetmvc" /><title>Recordatorio: mañana, ¡a por ASP.NET MVC!</title><content type="html">&lt;p&gt;Sólo recordaros que mañana martes 6, a las 19:30 (GMT+2), estaré charlando sobre ASP.NET MVC en el evento on-line organizado por &lt;a title="Second Nug" href="http://www.secondnug.com/"&gt;Second Nug&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Durante las dos horas de duración previstas veremos cómo crear una aplicación web completa con esta tecnología alternativa a Webforms, mientras vamos comentando técnicas, detalles y aspectos a tener en cuenta al desarrollar con ASP.NET MVC.&lt;/p&gt;  &lt;p&gt;&lt;a title="Registrarse como asistente del evento" href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032426662&amp;amp;Culture=es-ES"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px auto 5px; display: block; float: none; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_O9D62hXq-ng/SsnHuASv01I/AAAAAAAABIA/SN4ll0rFpOQ/image%5B6%5D.png?imgmax=800" width="472" height="64" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Nos os la perdáis, eh?! ;-)&lt;/p&gt;  &lt;p&gt;Enlaces:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032426662&amp;amp;EventCategory=4&amp;amp;culture=es-ES&amp;amp;CountryCode=ES"&gt;Registrarse como asistente al evento&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://office.microsoft.com/es-es/help/HA101733831033.aspx"&gt;Descarga del software Office Live Meeting&lt;/a&gt; (requerido para asistir) &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.secondnug.com/EventosDesarrollo/tabid/57/Default.aspx"&gt;Otros eventos de desarrollo de Second Nug&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Publicado en: &lt;a href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-5703660379937516286?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CSsZk3CUa9Z4o-T5SUEvadHC1HU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CSsZk3CUa9Z4o-T5SUEvadHC1HU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CSsZk3CUa9Z4o-T5SUEvadHC1HU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CSsZk3CUa9Z4o-T5SUEvadHC1HU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=svex43QbjCM:TBjP88q7-9U:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=svex43QbjCM:TBjP88q7-9U:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=svex43QbjCM:TBjP88q7-9U:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=svex43QbjCM:TBjP88q7-9U:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=svex43QbjCM:TBjP88q7-9U:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=svex43QbjCM:TBjP88q7-9U:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=svex43QbjCM:TBjP88q7-9U:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=svex43QbjCM:TBjP88q7-9U:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=svex43QbjCM:TBjP88q7-9U:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/svex43QbjCM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/5703660379937516286/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=5703660379937516286" title="3 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/5703660379937516286?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/5703660379937516286?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/svex43QbjCM/recordatorio-manana-por-aspnet-mvc.html" title="Recordatorio: mañana, ¡a por ASP.NET MVC!" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/10/recordatorio-manana-por-aspnet-mvc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04HQHYzcCp7ImA9WxNXFEo.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-7597255266844288176</id><published>2009-10-02T11:32:00.000+02:00</published><updated>2009-10-02T11:32:11.888+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-02T11:32:11.888+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="novedades" /><category scheme="http://www.blogger.com/atom/ns#" term="noticias" /><category scheme="http://www.blogger.com/atom/ns#" term="aspnetmvc" /><title>Publicada la segunda preview de ASP.NET MVC 2</title><content type="html">&lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://lh4.ggpht.com/_O9D62hXq-ng/SsXGBCweQUI/AAAAAAAABH8/Ayhirm7CzyQ/image%5B3%5D.png?imgmax=800" width="172" height="84" /&gt; Ayer mismo anunciaba &lt;a title="ASP.NET MVC 2 Preview 2 Released" href="http://haacked.com/archive/2009/10/01/asp.net-mvc-preview-2-released.aspx" hreflang="en"&gt;Phil Haack&lt;/a&gt;&lt;a title="ASP.NET MVC 2 Preview 2 Released" href="http://haacked.com/archive/2009/10/01/asp.net-mvc-preview-2-released.aspx"&gt;&lt;/a&gt; la publicación de la &lt;a title="ASP.NET MVC 2, Preview 2" href="http://go.microsoft.com/fwlink/?LinkID=154414"&gt;segunda preview de ASP.NET MVC 2&lt;/a&gt;, que continúa profundizando en las mejoras que ya se incluyeron en la primera entrega.&lt;/p&gt;  &lt;p&gt;Según se recoge en el documento de &lt;a title="Release notes" href="http://go.microsoft.com/fwlink/?LinkID=157066" hreflang="en"&gt;notas del producto&lt;/a&gt;&lt;a title="Release notes" href="http://go.microsoft.com/fwlink/?LinkID=157066"&gt;&lt;/a&gt;, las novedades que podremos encontrar son:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Abstracción del proveedor de metadatos, que será útil para implementar nuestros propios sistemas de obtención de metainformación sobre las clases del modelo, aunque por defecto se utilizarán los atributos presentes en &lt;code&gt;System.ComponentModel.DataAnnotations.&lt;/code&gt; &lt;/li&gt;    &lt;li&gt;Abstracción del proveedor de validaciones del modelo, que nos permitirá utilizar mecanismos personalizados de validación durante el proceso de &lt;em&gt;binding&lt;/em&gt;, que por defecto utilizará también las &lt;a title="System.ComponentModel.DataAnnotations" href="http://msdn.microsoft.com/es-es/library/system.componentmodel.dataannotations.aspx"&gt;DataAnnotations&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;Validación automática en cliente, que aunque permite la utilización de otros frameworks, la implementación por defecto utiliza el plugin &lt;a title="jQuery Validation" href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/"&gt;jQuery Validation&lt;/a&gt; para generar en cliente la lógica de validación descrita en los metadatos de las propiedades del modelo. De momento, soporta las siguientes &lt;code&gt;DataAnnotations:&lt;/code&gt;       &lt;ul&gt;       &lt;li&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;StringLengthAttribute, &lt;/code&gt;para limitar el tamaño máximo de un campo texto. &lt;/li&gt;        &lt;li&gt;&lt;code&gt;RequiredAttribute&lt;/code&gt;, para indicar la obligatoriedad de introducir un valor. &lt;/li&gt;        &lt;li&gt;&lt;code&gt;RegexAttribute&lt;/code&gt;, que añade la restricción de obligado cumplimiento de la expresión regular indicada. &lt;/li&gt;        &lt;li&gt;&lt;code&gt;RangeAttribute&lt;/code&gt;, para especificar el rango de valores de un campo (por ejemplo, un entero). &lt;/li&gt;     &lt;/ul&gt; Dado que el &lt;em&gt;model bi&lt;/em&gt;nder implementa las validaciones en servidor, parece que vamos en camino para ahorrarnos el trabajo sucio :-) &lt;/li&gt;    &lt;li&gt;Inclusión del filtro &lt;code&gt;RequireHttpsAttribute&lt;/code&gt;, que aplicado a una acción, fuerza a que ésta sea invocada utilizando el protocolo HTTPS. &lt;/li&gt;    &lt;li&gt;Inclusión del helper Html &lt;code&gt;HttpMethodOverride&lt;/code&gt;, que permite sobrescribir el verbo HTTP enviado por el cliente en aquellos agentes de usuario que no soportan los verbos menos frecuentes (PUT, DELETE…), introduciendo un campo oculto que es detectado posteriormente. &lt;/li&gt;    &lt;li&gt;Posibilidad de incluir áreas en un proyecto único, es decir, sin necesidad de crear proyectos independientes, facilitando además el registro de las mismas. &lt;/li&gt;    &lt;li&gt;El atributo &lt;code&gt;HiddenInputAttribute&lt;/code&gt; permite ahora especificar propiedades del modelo que deben ser renderizadas en cliente con un campo &lt;em&gt;hidden&lt;/em&gt;. &lt;/li&gt;    &lt;li&gt;Y otras mejoras, de las que selecciono sólo algunas:      &lt;ul&gt;       &lt;li&gt;&lt;code&gt;Controller.Execute()&lt;/code&gt; lanzará una excepción cuando sea llamado más de una vez en la misma instancia. Dado que una instancia del controlador debe atender exclusivamente a una petición, es una medida que ayuda a prevenir problemas con contenedores IoC configurados para generar singletons, por ejemplo. &lt;/li&gt;        &lt;li&gt;Inclusión de nuevos verbos HTTP, como PUT o DELETE para facilitar la creación de sistemas REST. &lt;/li&gt;        &lt;li&gt;Soporte para el tipo de datos &lt;code&gt;DataType.Password&lt;/code&gt;, haciendo que se rendericen como cuadros de edición de tipo password las propiedades que sean marcadas con este atributo. &lt;/li&gt;        &lt;li&gt;Se ha establecido como editor para los booleanos anulables un desplegable con las opciones “No especificado”, “Sí” y “No”. &lt;/li&gt;        &lt;li&gt;Mejoras de eficiencia, introduciendo una caché de expresiones compiladas para los helpers que utilizan sintaxis lambda fuertemente tipada. &lt;/li&gt;        &lt;li&gt;(Podéis ver el resto en el documento de &lt;a title="Release notes" href="http://go.microsoft.com/fwlink/?LinkID=157066" hreflang="en"&gt;notas del producto&lt;/a&gt;). &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;De momento todavía no funciona con la beta de Visual Studio 2010, sólo con las versiones 2008 convenientemente servicepackeadas.&lt;/p&gt;  &lt;p&gt;Enlaces:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a title="Descargar instalable de ASP.NET MVC 2 Preview 2" href="http://go.microsoft.com/fwlink/?LinkID=154414"&gt;Descargar ASP.NET MVC 2 Preview 2&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a title="Fuentes de ASP.NET MVC 2 Preview 2" href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33836"&gt;Descargar fuentes&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-7597255266844288176?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8Yz7HXKUTKpZYrOq5qM-1wLRf2Q/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8Yz7HXKUTKpZYrOq5qM-1wLRf2Q/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8Yz7HXKUTKpZYrOq5qM-1wLRf2Q/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8Yz7HXKUTKpZYrOq5qM-1wLRf2Q/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=5Qo_T1rMs5A:llSRoB_qcRI:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=5Qo_T1rMs5A:llSRoB_qcRI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=5Qo_T1rMs5A:llSRoB_qcRI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=5Qo_T1rMs5A:llSRoB_qcRI:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=5Qo_T1rMs5A:llSRoB_qcRI:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=5Qo_T1rMs5A:llSRoB_qcRI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=5Qo_T1rMs5A:llSRoB_qcRI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=5Qo_T1rMs5A:llSRoB_qcRI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=5Qo_T1rMs5A:llSRoB_qcRI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/5Qo_T1rMs5A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/7597255266844288176/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=7597255266844288176" title="4 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/7597255266844288176?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/7597255266844288176?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/5Qo_T1rMs5A/publicada-la-segunda-preview-de-aspnet.html" title="Publicada la segunda preview de ASP.NET MVC 2" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/10/publicada-la-segunda-preview-de-aspnet.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YDQHk-cCp7ImA9WxNXEUs.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-1892996345155022016</id><published>2009-09-28T21:10:00.002+02:00</published><updated>2009-09-28T21:12:51.758+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-28T21:12:51.758+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="charlas" /><category scheme="http://www.blogger.com/atom/ns#" term="aspnetmvc" /><category scheme="http://www.blogger.com/atom/ns#" term="servicios on-line" /><title>Charla en Second Nug sobre ASP.NET MVC</title><content type="html">&lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px 10px; display: inline; border-top: 0px; border-right: 0px" title="Cartel del evento" border="0" alt="image" align="right" src="http://lh6.ggpht.com/_O9D62hXq-ng/SsEBm09xt1I/AAAAAAAABH4/gLU7Cpt7dsA/image%5B1%5D.png?imgmax=800" width="296" height="220" /&gt;Los chicos de &lt;a title="Second Nug" href="http://www.secondnug.com/"&gt;Second Nug&lt;/a&gt; han tenido la amabilidad de invitarme a dar una charla sobre ASP.NET MVC el próximo martes 6 de octubre, de 19:30 a 21:30 horas, hora peninsular (GMT+2). Y obviamente, no podía rechazar la oportunidad de hablar un rato sobre esta tecnología de desarrollo de aplicaciones web que tanto me gusta. :-)&lt;/p&gt;  &lt;p&gt;Como otros eventos organizados por el grupo, se trata de un &lt;a title="Qué es un Webcast, en la Wikipedia" href="http://es.wikipedia.org/wiki/Webcast"&gt;Webcast&lt;/a&gt;, la asistencia es gratuita y el aforo ilimitado; sólo necesitáis &lt;a title="Registrarse para el evento" href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032426662&amp;amp;Culture=es-ES"&gt;registraros en el sitio web de Microsoft&lt;/a&gt; y estar el día de autos frente a un ordenador con conexión a Internet, el software gratuito &lt;a title="Descargar Office Live Meeting" href="http://office.microsoft.com/es-es/help/HA101733831033.aspx"&gt;Live Meeting&lt;/a&gt;, y una gran bolsa de palomitas. Dado que el principal objetivo de la sesión será mostrar los conceptos básicos del desarrollo con ASP.NET MVC, no es necesario que contéis con conocimientos previos sobre dicho framework.&lt;/p&gt;  &lt;p&gt;La charla será estructurada como entiendo que deben hacerse estas cosas: poca teoría y mucha acción. Primero describiré algo de la filosofía y principios fundamentales, y seguidamente pasaremos a desarrollar una aplicación completa partiendo desde cero (Archivo&amp;gt;Nuevo&amp;gt;Proyecto), aprovechando cada funcionalidad para comentar técnicas y detalles a tener en cuenta al desarrollar con este marco de trabajo. &lt;/p&gt;  &lt;p&gt;Espero veros por allí, paso lista ;-)&lt;/p&gt;  &lt;p&gt;Enlaces:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a title="Eventos de desarrollo de Second Nug" href="http://www.secondnug.com/EventosDesarrollo/tabid/57/Default.aspx"&gt;Eventos de desarrollo de Second Nug&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a title="Registrarse como asistente al evento" href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032426662&amp;amp;EventCategory=4&amp;amp;culture=es-ES&amp;amp;CountryCode=ES"&gt;Registrarse como asistente al evento&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a title="Descarga del software Office Live Meeting" href="http://office.microsoft.com/es-es/help/HA101733831033.aspx"&gt;Descarga del software Office Live Meeting&lt;/a&gt; (requerido para asistir) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-1892996345155022016?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ufksRvx79yuYuXyssy0giqv2GlU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ufksRvx79yuYuXyssy0giqv2GlU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ufksRvx79yuYuXyssy0giqv2GlU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ufksRvx79yuYuXyssy0giqv2GlU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=AFdI0IKg2-s:V89_8_JA3as:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=AFdI0IKg2-s:V89_8_JA3as:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=AFdI0IKg2-s:V89_8_JA3as:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=AFdI0IKg2-s:V89_8_JA3as:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=AFdI0IKg2-s:V89_8_JA3as:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=AFdI0IKg2-s:V89_8_JA3as:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=AFdI0IKg2-s:V89_8_JA3as:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=AFdI0IKg2-s:V89_8_JA3as:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=AFdI0IKg2-s:V89_8_JA3as:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/AFdI0IKg2-s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/1892996345155022016/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=1892996345155022016" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/1892996345155022016?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/1892996345155022016?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/AFdI0IKg2-s/charla-en-second-nug-sobre-aspnet-mvc.html" title="Charla en Second Nug sobre ASP.NET MVC" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/09/charla-en-second-nug-sobre-aspnet-mvc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcMQX08fCp7ImA9WxNQF0k.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-2014020792677898953</id><published>2009-09-23T23:58:00.000+02:00</published><updated>2009-09-23T23:58:00.374+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-23T23:58:00.374+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><category scheme="http://www.blogger.com/atom/ns#" term="aspnetmvc" /><category scheme="http://www.blogger.com/atom/ns#" term="seguridad" /><category scheme="http://www.blogger.com/atom/ns#" term="trucos" /><title>Eliminar los encabezados X-AspNet* de las respuestas en ASP.NET MVC (y ASP.NET)</title><content type="html">&lt;p&gt;Si observamos las respuestas enviadas al cliente que solicita una página de un sitio web creado con el framework MVC, veremos que, además de los encabezados HTTP estándar, el sistema añade información sobre las versiones de ASP.NET y del propio framework MVC que estamos utilizando:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px auto 5px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Encabezados X-ASPNet*" border="0" alt="Encabezados X-ASPNet*" src="http://lh6.ggpht.com/_O9D62hXq-ng/Spl65hP6mwI/AAAAAAAABGQ/xgPrDij0U_4/image%5B15%5D.png?imgmax=800" width="390" height="189" /&gt; &lt;/p&gt;  &lt;p&gt;Esta información, además de consumir ancho de banda (poco, todo hay que decirlo, pero nada despreciable en sitios con tráfico muy alto), aportan información que posibles atacantes podrían utilizar para sacar provecho a vulnerabilidades conocidas de estos productos. En mi opinión, lo mejor es mostrar los menores detalles posibles al respecto.&lt;/p&gt;  &lt;p&gt;Si queremos eliminar la pista correspondiente a la versión de ASP.NET sobre la que corre el sistema (X-AspNet-Version), bastaría con introducir en el &lt;em&gt;web.config&lt;/em&gt; la siguiente declaración:     &lt;br /&gt;&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;configuration&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;system.web&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;httpRuntime&lt;/span&gt; &lt;span style="color: #ff0000"&gt;enableVersionHeader&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;system.web&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;configuration&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Para eliminar, además, la información sobre la versión de ASP.NET MVC framework en ejecución (X-AspNetMvc-Version), tendremos que introducir el siguiente código para que se ejecute durante la inicialización de la aplicación, en el global.asax, indicando así que deseamos deshabilitar el envío de este encabezado:   &lt;br /&gt;&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Application_Start()&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [...] &lt;span style="color: #008000"&gt;// Otro código de inicialización&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    MvcHandler.DisableMvcResponseHeader = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Y con eso basta. El resultado, el que sigue:&lt;/p&gt;&lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px auto 5px; display: block; float: none; border-top: 0px; border-right: 0px" title="Encabezados sin información extra" border="0" alt="Encabezados sin información extra" src="http://lh4.ggpht.com/_O9D62hXq-ng/Spl66NJa86I/AAAAAAAABGU/jPg4Kgh_nEE/image%5B20%5D.png?imgmax=800" width="372" height="135" /&gt; &lt;/p&gt;&lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-2014020792677898953?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4I5z6sQ-EBupHtN6dCU92KYsvcg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4I5z6sQ-EBupHtN6dCU92KYsvcg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4I5z6sQ-EBupHtN6dCU92KYsvcg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4I5z6sQ-EBupHtN6dCU92KYsvcg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=1Xbigg7lW6U:IPtYDr5q6z8:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=1Xbigg7lW6U:IPtYDr5q6z8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=1Xbigg7lW6U:IPtYDr5q6z8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=1Xbigg7lW6U:IPtYDr5q6z8:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=1Xbigg7lW6U:IPtYDr5q6z8:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=1Xbigg7lW6U:IPtYDr5q6z8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=1Xbigg7lW6U:IPtYDr5q6z8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=1Xbigg7lW6U:IPtYDr5q6z8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=1Xbigg7lW6U:IPtYDr5q6z8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/1Xbigg7lW6U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/2014020792677898953/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=2014020792677898953" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/2014020792677898953?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/2014020792677898953?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/1Xbigg7lW6U/eliminar-los-encabezados-x-aspnet-de.html" title="Eliminar los encabezados X-AspNet* de las respuestas en ASP.NET MVC (y ASP.NET)" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/09/eliminar-los-encabezados-x-aspnet-de.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQGQXs9fSp7ImA9WxNQFEU.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-5260813168294877209</id><published>2009-09-21T01:12:00.001+02:00</published><updated>2009-09-21T01:12:00.565+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-21T01:12:00.565+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="novedades" /><category scheme="http://www.blogger.com/atom/ns#" term="bases de datos" /><category scheme="http://www.blogger.com/atom/ns#" term="orm" /><category scheme="http://www.blogger.com/atom/ns#" term=".net" /><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="software libre" /><category scheme="http://www.blogger.com/atom/ns#" term="interfaces fluidos" /><title>Fluent NHibernate 1.0 publicado</title><content type="html">&lt;p&gt;A finales del agosto, &lt;a title="Anuncio del lanzamiento de Fluent NHibernate" href="http://nhforge.org/blogs/nhibernate/archive/2009/08/29/fluent-nhibernate-1-0.aspx" hreflang="en"&gt;James Gregory&lt;/a&gt;&lt;a title="Anuncio del lanzamiento de Fluent NHibernate" href="http://nhforge.org/blogs/nhibernate/archive/2009/08/29/fluent-nhibernate-1-0.aspx"&gt;&lt;/a&gt; anunció la publicación de la versión 1.0 de &lt;a title="Fluent NHibernate home" href="http://fluentnhibernate.org/"&gt;Fluent NHibernate&lt;/a&gt;, una librería que ofrece una ágil alternativa a los espesos archivos de configuración de &lt;a title="NHibernate" href="http://nhforge.org/"&gt;NHibernate&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Su API permite configurar desde el código de una aplicación, de &lt;a title="Interfaces fluidos en Variable not found" href="http://www.variablenotfound.com/2007/11/interfaces-fluidos-fluent-interfaces.html"&gt;forma fluida&lt;/a&gt; la mayoría de las veces, los mapeos entre la estructura de una base de datos relacional y el modelo de objetos que utiliza. Así, evitaremos la manipulación de grandes archivos XML, a la vez que podremos beneficiarnos de la validación en tiempo de compilación y, por supuesto, de posibilidades como la refactorización y el intellisense durante el desarrollo.&lt;/p&gt;  &lt;p&gt;El siguiente código muestra el mapeo de la entidad &lt;code&gt;Cat&lt;/code&gt; con sus propiedades, algunas de ellas con restricciones, y relaciones con otras entidades a uno (&lt;code&gt;References&lt;/code&gt;) y a varios (&lt;code&gt;HasMany&lt;/code&gt;); el nombre de la tabla y campos en el modelo relacional es el mismo que el de las propiedades, gracias a la &lt;a title="Convención sobre configuración, en la wikipedia" href="http://es.wikipedia.org/wiki/Convenci%C3%B3n_sobre_Configuraci%C3%B3n"&gt;convención sobre configuración&lt;/a&gt;, lo que permite simplificar código respecto a su equivalente XML:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; CatMap : ClassMap&amp;lt;Cat&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; CatMap()&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  {&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    Id(x =&amp;gt; x.Id);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    Map(x =&amp;gt; x.Name)&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      .Length(16)&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      .Not.Nullable();&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    Map(x =&amp;gt; x.Sex);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    References(x =&amp;gt; x.Mate);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    HasMany(x =&amp;gt; x.Kittens);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  }&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Como podemos observar, el equivalente XML es mucho más verboso:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #800000"&gt;xml&lt;/span&gt; &lt;span style="color: #ff0000"&gt;version&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;encoding&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;utf-8&amp;quot;&lt;/span&gt; ?&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;hibernate-mapping&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;urn:nhibernate-mapping-2.2&amp;quot;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #ff0000"&gt;namespace&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;QuickStart&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;assembly&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;QuickStart&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;class&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Cat&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;table&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Cat&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;id&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Id&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;generator&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;identity&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;property&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Name&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;column&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Name&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;length&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;16&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;not-null&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;property&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;property&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Sex&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;many-to-one&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Mate&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;bag&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Kittens&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;key&lt;/span&gt; &lt;span style="color: #ff0000"&gt;column&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;mother_id&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;one-to-many&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Cat&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;bag&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;hibernate-mapping&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Otra de las ventajas que aporta es el &lt;a title="Auto-mapping en Fluent NHibernate" href="http://wiki.fluentnhibernate.org/Auto_mapping" hreflang="en"&gt;auto-mapping&lt;/a&gt;&lt;a title="Auto-mapping en Fluent NHibernate" href="http://wiki.fluentnhibernate.org/Auto_mapping"&gt;&lt;/a&gt;, que hace utilización intensiva del principio de convención sobre configuración para generar de forma automática mapeos de aquellas entidades que atiendan a unas normas preestablecidas (aunque modificables). El siguiente código muestra la forma tan sencilla de crear los mapeos de todas las entidades definidas en el espacio de nombres &lt;code&gt;MiApp.Entidades&lt;/code&gt;, dentro del ensamblado donde se definió la entidad &lt;code&gt;Producto&lt;/code&gt;:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;var autoMappings = AutoMap.AssemblyOf&amp;lt;Producto&amp;gt;()&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  .Where(t =&amp;gt; t.Namespace == &lt;span style="color: #006080"&gt;&amp;quot;MiApp.Entidades&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;br /&gt;Además del mapeo objeto-relacional, el software abarca también la configuración del acceso a datos de NHibernate a través de su interfaz de programación. El siguiente código muestra la inicialización de la conexión a una base de datos SQL Server 2005, tomando la cadena de conexión del &lt;code&gt;AppSettings&lt;/code&gt; y mapeando automáticamente las entidades que se encuentren definidas en un &lt;em&gt;namespace&lt;/em&gt; concreto:&lt;/div&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;var sessionFactory = Fluently.Configure()&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    .Database(MsSqlConfiguration.MsSql2005&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      .ConnectionString(c =&amp;gt; c.FromAppSetting(&lt;span style="color: #006080"&gt;&amp;quot;connectionString&amp;quot;&lt;/span&gt;))&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    .Mappings(m =&amp;gt; m.AutoMappings.Add(&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      AutoMap.AssemblyOf&amp;lt;Producto&amp;gt;(type =&amp;gt; type.Namspace.EndsWith(&lt;span style="color: #006080"&gt;&amp;quot;Entidades&amp;quot;&lt;/span&gt;))))&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  .BuildSessionFactory();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Y por último, hay otra característica muy interesante vistas a la realización de pruebas unitarias sobre los mecanismos de persistencia. El código mostrado a continuación crea una instancia de la clase &lt;code&gt;Empleado&lt;/code&gt;, la inserta en la base de datos, realiza una lectura de la entidad y la compara con la original, de forma automática:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;[Test]&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; EmpleadoMapeaCorrectamente()&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PersistenceSpecification&amp;lt;Empleado&amp;gt;(session)&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        .CheckProperty(emp =&amp;gt; emp.Id, 1)&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        .CheckProperty(emp =&amp;gt; emp.Nombre, &lt;span style="color: #006080"&gt;&amp;quot;José&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        .CheckProperty(emp =&amp;gt; emp.Apellidos, &lt;span style="color: #006080"&gt;&amp;quot;Aguilar&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        .VerifyTheMappings();&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Más información en la &lt;a title="Wiki de Fluent NHibernate" href="http://wiki.fluentnhibernate.org/Main_Page" hreflang="en"&gt;wiki del proyecto&lt;/a&gt;&lt;a title="Wiki de Fluent NHibernate" href="http://wiki.fluentnhibernate.org/Main_Page"&gt;&lt;/a&gt;. Y las descargas, desde &lt;a title="Download Fluent NHibernate" href="http://fluentnhibernate.org/downloads" hreflang="en"&gt;aquí&lt;/a&gt;&lt;a title="Download Fluent NHibernate" href="http://fluentnhibernate.org/downloads"&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-5260813168294877209?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_q5My8y8Jc3pKNVCWobbddOOlG8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_q5My8y8Jc3pKNVCWobbddOOlG8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_q5My8y8Jc3pKNVCWobbddOOlG8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_q5My8y8Jc3pKNVCWobbddOOlG8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=JTWzsXznXI8:Et3VdqganJM:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=JTWzsXznXI8:Et3VdqganJM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=JTWzsXznXI8:Et3VdqganJM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=JTWzsXznXI8:Et3VdqganJM:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=JTWzsXznXI8:Et3VdqganJM:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=JTWzsXznXI8:Et3VdqganJM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=JTWzsXznXI8:Et3VdqganJM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=JTWzsXznXI8:Et3VdqganJM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=JTWzsXznXI8:Et3VdqganJM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/JTWzsXznXI8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/5260813168294877209/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=5260813168294877209" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/5260813168294877209?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/5260813168294877209?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/JTWzsXznXI8/fluent-nhibernate-10-publicado.html" title="Fluent NHibernate 1.0 publicado" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/09/fluent-nhibernate-10-publicado.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MFQ3c_eyp7ImA9WxNQEUw.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-7900787154330901659</id><published>2009-09-16T17:36:00.000+02:00</published><updated>2009-09-16T17:36:52.943+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-16T17:36:52.943+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="novedades" /><category scheme="http://www.blogger.com/atom/ns#" term="noticias" /><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="ajax" /><category scheme="http://www.blogger.com/atom/ns#" term="servicios on-line" /><category scheme="http://www.blogger.com/atom/ns#" term="scripting" /><title>Más javascript en la red: Microsoft Ajax CDN</title><content type="html">&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 5px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Logo de ASP.NET Ajax" border="0" alt="Logo de ASP.NET Ajax" align="right" src="http://lh4.ggpht.com/_O9D62hXq-ng/SrEFUUuZDiI/AAAAAAAABHo/EE6wrdelvv8/image%5B5%5D.png?imgmax=800" width="224" height="85" /&gt; Hace unos meses comentaba la posibilidad de utilizar la infraestructura de &lt;a title="Deja que Google aloje tus librerías javascript" href="http://www.variablenotfound.com/2009/02/deja-que-google-aloje-tus-librerias.html"&gt;Google para alojar las librerías javascript&lt;/a&gt; de nuestras aplicaciones. Pues bien, ahora es Microsoft la que ha lanzado un servicio similar, &lt;a title="Microsoft Ajax CDN" href="http://www.asp.net/ajax/cdn/" hreflang="en"&gt;Microsoft Ajax CDN&lt;/a&gt;&lt;a title="Microsoft Ajax CDN" href="http://www.asp.net/ajax/cdn/"&gt;&lt;/a&gt;, una red de distribución de contenidos desde donde podemos descargar en tiempo de ejecución las librerías de scripts que utilicemos en nuestras aplicaciones.&lt;/p&gt;  &lt;p&gt;O en otras palabras, que podemos hacer uso de forma gratuita de estas librerías, sin limitación de ancho de banda e independientemente de si es para fines comerciales o no. Basta con referenciarlas desde nuestro código:&lt;/p&gt;  &lt;div&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://ajax.microsoft.com/ajax/jquery-1.3.2.min.js&amp;quot;&lt;/span&gt; &lt;br /&gt;        &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;La principal ventaja que ofrece este método es la velocidad con la que estos archivos serán servidos, puesto que se usa la infraestructura del gigante de Redmon, a la vez que se comparte la caché con otros sitios web que también las estén utilizando. También brinda la posibilidad de utilizar scripting a sitios web que no disponen de permisos para subir archivos (como la plataforma &lt;a title="Blogger" href="http://www.blogger.com"&gt;blogger&lt;/a&gt;)&lt;/p&gt;&lt;p&gt;A diferencia del servicio de Google, desde esta CDN sólo podemos encontrar de momento las librerías que oficialmente forman parte de la plataforma de desarrollo de Microsoft, como las propias de ASP.NET Ajax, jQuery y aquellos plugins que vayan añadiéndose. En la dirección &lt;a title="http://www.asp.net/ajax/cdn/" href="http://www.asp.net/ajax/cdn/" hreflang="en"&gt;http://www.asp.net/ajax/cdn/&lt;/a&gt; pueden consultarse la lista completa de librerías, con sus correspondientes direcciones de descarga.&lt;img style="border-right-width: 0px; margin: 0px 0px 5px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="EnableCdn en ScriptManager" border="0" alt="EnableCdn en ScriptManager" align="right" src="http://lh6.ggpht.com/_O9D62hXq-ng/SrEFU8QVFCI/AAAAAAAABHs/8IhvgLf_Qv0/image%5B2%5D.png?imgmax=800" width="244" height="122" /&gt;&lt;/p&gt;&lt;p&gt;Adicionalmente, Scott Guthrie &lt;a title="Anunciando Microsoft Ajax CDN" href="http://weblogs.asp.net/scottgu/archive/2009/09/15/announcing-the-microsoft-ajax-cdn.aspx" hreflang="en"&gt;comentaba en su blog&lt;/a&gt; que el nuevo control &lt;code&gt;ScriptManager&lt;/code&gt; que vendrá con ASP.NET 4.0 incluye una propiedad llamada &lt;code&gt;EnableCdn&lt;/code&gt; que permitirá activar la descarga de las librerías Ajax y todas aquellas necesarias para el funcionamiento de controles, directamente desde sus servidores. &lt;/p&gt;&lt;p&gt;Los inconvenientes, pues los mismos que los del servicio de Google: si no disponemos de conexión a la red en tiempo de desarrollo, podemos tenerlo realmente crudo.&lt;/p&gt;&lt;p&gt;Más información en: &lt;a href="http://www.asp.net/ajax/cdn"&gt;www.asp.net/ajax/cdn&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-7900787154330901659?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/so_VyomoJHD7nIvOf-VkOlPPOZo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/so_VyomoJHD7nIvOf-VkOlPPOZo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/so_VyomoJHD7nIvOf-VkOlPPOZo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/so_VyomoJHD7nIvOf-VkOlPPOZo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=MpfaRY_s_as:gHkMeBe4_QU:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=MpfaRY_s_as:gHkMeBe4_QU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=MpfaRY_s_as:gHkMeBe4_QU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=MpfaRY_s_as:gHkMeBe4_QU:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=MpfaRY_s_as:gHkMeBe4_QU:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=MpfaRY_s_as:gHkMeBe4_QU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=MpfaRY_s_as:gHkMeBe4_QU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=MpfaRY_s_as:gHkMeBe4_QU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=MpfaRY_s_as:gHkMeBe4_QU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/MpfaRY_s_as" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/7900787154330901659/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=7900787154330901659" title="1 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/7900787154330901659?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/7900787154330901659?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/MpfaRY_s_as/mas-javascript-en-la-red-microsoft-ajax.html" title="Más javascript en la red: Microsoft Ajax CDN" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/09/mas-javascript-en-la-red-microsoft-ajax.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C04AQXw9eip7ImA9WxNQEEg.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-8369991820018378876</id><published>2009-09-15T23:59:00.001+02:00</published><updated>2009-09-15T23:59:00.262+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-15T23:59:00.262+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".net" /><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><category scheme="http://www.blogger.com/atom/ns#" term="trucos" /><title>Inicializar a null propiedades sin tipo</title><content type="html">&lt;p&gt;No es algo que ocurra muy frecuentemente, pero en determinadas ocasiones puede ser útil inicializar una propiedad de un tipo anónimo con el valor nulo, por ejemplo:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt; &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt; &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;var conductor = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; { Nombre = ”Marisa”, Edad = 34, Auto = “Renault Megane” };&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;var peaton = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; { Nombre = “Juan”, Edad = 43, Auto = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; };&lt;/pre&gt; &lt;!--CRLF--&gt;&lt;/div&gt; &lt;/div&gt;&lt;p&gt;En el código anterior se entiende que lo que queremos indicar estableciendo la propiedad &lt;code&gt;Auto&lt;/code&gt; a &lt;code&gt;null&lt;/code&gt; es que la persona que estamos representando no dispone de automóvil, o bien no conocemos este dato.&lt;/p&gt;&lt;p&gt;Algo muy normal… sino fuera porque el compilador se empeña en abofetearnos con el siguiente error:&lt;/p&gt;&lt;blockquote&gt; &lt;p&gt;Cannot assign &amp;lt;null&amp;gt; to anonymous type property&lt;/p&gt; &lt;/blockquote&gt;&lt;p&gt;Y la verdad, en cuanto lo pensamos un poco, tiene sentido. En los casos anteriores, se está instanciando un tipo anónimo cuyas propiedades son generadas en tiempo de compilación. En el caso anterior, el compilador crearía para el tipo anónimo una propiedad “Nombre” de tipo &lt;code&gt;string&lt;/code&gt;, una “Edad” de tipo &lt;code&gt;integer&lt;/code&gt;, y una “Auto”, de tipo… ¿qué tipo podría asignar el compilador a esta propiedad? Ese es precisamente el  problema.&lt;/p&gt;&lt;p&gt;Lo mismo ocurre al intentar inicializar variables implícitamente tipadas con el valor nulo; aunque cambia el error, el concepto idéntico, el compilador no es capaz de inferir el tipo de la variable:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt; &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt; &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;var persona = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;; // Error: Cannot assign &amp;lt;&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;&amp;gt; to an implicitly-typed local variable&lt;/pre&gt; &lt;!--CRLF--&gt;&lt;/div&gt; &lt;/div&gt;&lt;p&gt;La forma de solucionarlo en ambos casos es muy sencilla: basta con informar explícitamente al compilador del tipo de la propiedad, para que pueda crearla sin problema, por ejemplo así:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt; &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt; &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;var peaton = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; { Nombre = &lt;span style="color: #006080"&gt;&amp;quot;Juan&amp;quot;&lt;/span&gt;, Edad = 43, Auto = (&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;)&lt;span style="color: #0000ff"&gt;null&lt;/span&gt; };&lt;/pre&gt; &lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;var persona = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; Persona;&lt;/pre&gt; &lt;!--CRLF--&gt;&lt;/div&gt; &lt;/div&gt;&lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-8369991820018378876?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ItO9nMDQtNZ7VEa-YoFZMzM91V0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ItO9nMDQtNZ7VEa-YoFZMzM91V0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ItO9nMDQtNZ7VEa-YoFZMzM91V0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ItO9nMDQtNZ7VEa-YoFZMzM91V0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=gimNAxU6_H4:NO2hXQSgL0s:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=gimNAxU6_H4:NO2hXQSgL0s:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=gimNAxU6_H4:NO2hXQSgL0s:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=gimNAxU6_H4:NO2hXQSgL0s:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=gimNAxU6_H4:NO2hXQSgL0s:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=gimNAxU6_H4:NO2hXQSgL0s:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=gimNAxU6_H4:NO2hXQSgL0s:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=gimNAxU6_H4:NO2hXQSgL0s:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=gimNAxU6_H4:NO2hXQSgL0s:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/gimNAxU6_H4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/8369991820018378876/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=8369991820018378876" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/8369991820018378876?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/8369991820018378876?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/gimNAxU6_H4/inicializar-null-propiedades-sin-tipo.html" title="Inicializar a null propiedades sin tipo" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/09/inicializar-null-propiedades-sin-tipo.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cMQXo4eCp7ImA9WxNRGEo.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-57794275951976296</id><published>2009-09-13T23:58:00.000+02:00</published><updated>2009-09-13T23:58:00.430+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-13T23:58:00.430+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="proyectos" /><category scheme="http://www.blogger.com/atom/ns#" term="equipos" /><category scheme="http://www.blogger.com/atom/ns#" term="humor" /><category scheme="http://www.blogger.com/atom/ns#" term="scrum" /><title>¿Comprometidos o involucrados?</title><content type="html">&lt;p&gt;Juan Palacio, en su genial &lt;a title="Navegápolis" href="http://www.navegapolis.net/"&gt;Navegápolis&lt;/a&gt;, publicó semanas atrás unos buenos materiales de un &lt;a title="Curso Abierto de SCRUM" href="http://www.navegapolis.net/content/view/916/62/"&gt;Curso de Scrum&lt;/a&gt; en los que he podido recordar una historieta que encontré hace tiempo sobre la diferencia entre la implicación y el compromiso en la realización de un proyecto:&lt;/p&gt;  &lt;p&gt;&lt;a title="Historia de la gallina y el cerdo" href="http://www.implementingscrum.com/translations/"&gt;&lt;img style="border-right-width: 0px; margin: 0px auto 5px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="La historia de la gallina y el cerdo" border="0" alt="La historia de la gallina y el cerdo" src="http://lh5.ggpht.com/_O9D62hXq-ng/SpV646d4NVI/AAAAAAAABF4/lNDEWE2GBIw/image%5B5%5D.png?imgmax=800" width="629" height="224" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Aunque esta metáfora se utiliza en &lt;a title="Scrum en la wikipedia" href="http://es.wikipedia.org/wiki/Scrum"&gt;Scrum&lt;/a&gt; para agrupar los roles principales distinguiendo entre aquellos que ponen “la carne en el asador” (cerdos), y el resto de afectados y participantes (gallinas), es igualmente aplicable a las actitudes de los componentes de un equipo de trabajo, independientemente de la metodología utilizada.&lt;/p&gt;  &lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-57794275951976296?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7c6p-5Ake26DNQIQF5OGmLBENM8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7c6p-5Ake26DNQIQF5OGmLBENM8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7c6p-5Ake26DNQIQF5OGmLBENM8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7c6p-5Ake26DNQIQF5OGmLBENM8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=x8xDwGS85RM:yhceFkZbcYc:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=x8xDwGS85RM:yhceFkZbcYc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=x8xDwGS85RM:yhceFkZbcYc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=x8xDwGS85RM:yhceFkZbcYc:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=x8xDwGS85RM:yhceFkZbcYc:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=x8xDwGS85RM:yhceFkZbcYc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=x8xDwGS85RM:yhceFkZbcYc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=x8xDwGS85RM:yhceFkZbcYc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=x8xDwGS85RM:yhceFkZbcYc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/x8xDwGS85RM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/57794275951976296/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=57794275951976296" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/57794275951976296?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/57794275951976296?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/x8xDwGS85RM/comprometidos-o-involucrados.html" title="¿Comprometidos o involucrados?" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/09/comprometidos-o-involucrados.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4ER3g5eCp7ImA9WxNRFU8.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-1183914987664047203</id><published>2009-09-09T21:18:00.000+02:00</published><updated>2009-09-09T21:18:26.620+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-09T21:18:26.620+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="novedades" /><category scheme="http://www.blogger.com/atom/ns#" term="bases de datos" /><category scheme="http://www.blogger.com/atom/ns#" term="orm" /><category scheme="http://www.blogger.com/atom/ns#" term=".net" /><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="linq" /><title>Linq para NHibernate, versión 1.0</title><content type="html">&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 5px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Logo de NHibernate " border="0" alt="Logo de NHibernate " align="right" src="http://lh4.ggpht.com/_O9D62hXq-ng/SpwQo3u0CBI/AAAAAAAABHQ/XAoSod8e28c/image3.png?imgmax=800" width="246" height="66" /&gt; Hace unas semanas, &lt;a href="http://ayende.com/blog"&gt;Oren Eini&lt;/a&gt; (o Ayende Raihen, como se le suele conocer) &lt;a title="Linq para NHibernate, v1.0" href="http://ayende.com/Blog/archive/2009/07/26/nhibernate-linq-1.0-released.aspx"&gt;comunicaba&lt;/a&gt; la liberación de la versión 1.0 del proveedor de Linq para NHibernate, una característica altamente demandada por los usuarios desde la aparición del lenguaje de consulta integrado en .NET.&lt;/p&gt;  &lt;p&gt;Aunque será incluido como parte del producto NHibernate en versiones venideras, han decidido liberar la actual release del proveedor como paquete independiente para que pueda comenzar a utilizarse desde este momento. Está siendo testado en multitud de aplicaciones en producción desde hace varios años, y al parecer el funcionamiento es más que correcto.&lt;/p&gt;  &lt;p&gt;¿Y cómo puede ayudarte este proveedor, si eres usuario de NHibernate? El siguiente ejemplo, tomado de &lt;a title="Ejemplo de simplificación de consulta con Linq" href="http://www.caffeinatedcoder.com/linq-to-nhibernate/"&gt;Caffeinated Coder&lt;/a&gt; muestra cómo una consulta a base de datos puede simplificarse y hacerse mucho más legible utilizando Linq, además de beneficiarse del tipado fuerte, intellisense y comprobaciones en tiempo de compilación:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Utilizando el API de NHibernate:&lt;/strong&gt;&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IList&amp;lt;Call&amp;gt; GetCallsByDate(DateTime beginDate, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; interpreterId)   &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{   &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    ICriteria criteria = Session.CreateCriteria(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(Call))&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        .CreateAlias(&lt;span style="color: #006080"&gt;&amp;quot;Customer&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Customer&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        .Add(Restrictions.Gt(&lt;span style="color: #006080"&gt;&amp;quot;StartTime&amp;quot;&lt;/span&gt;, beginDate))&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        .Add(&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            Restrictions.Or(&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                Restrictions.Lt(&lt;span style="color: #006080"&gt;&amp;quot;EndTime&amp;quot;&lt;/span&gt;, DateTime.Now), Restrictions.IsNull(&lt;span style="color: #006080"&gt;&amp;quot;EndTime&amp;quot;&lt;/span&gt;))&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            )&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        .Add(Restrictions.Eq(&lt;span style="color: #006080"&gt;&amp;quot;Interpreter.Id&amp;quot;&lt;/span&gt;, interpreterId))&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        .AddOrder(Order.Desc(&lt;span style="color: #006080"&gt;&amp;quot;StartTime&amp;quot;&lt;/span&gt;))&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        .AddOrder(Order.Desc(&lt;span style="color: #006080"&gt;&amp;quot;Customer.Name&amp;quot;&lt;/span&gt;)); &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; criteria.List&amp;lt;Call&amp;gt;() &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; List&amp;lt;Call&amp;gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Utilizando Linq:&lt;/strong&gt;&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IList&amp;lt;Call&amp;gt; GetCallsByDateWithLinq(DateTime beginDate, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; interpreterId)  &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{   &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    var query = from call &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; Session.Linq&amp;lt;Call&amp;gt;()&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;where&lt;/span&gt; call.StartTime &amp;gt; beginDate&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &amp;amp;&amp;amp; (call.EndTime == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; || call.EndTime &amp;lt; DateTime.Now )   &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &amp;amp;&amp;amp; call.Interpreter.Id == interpreterId&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        orderby call.StartTime descending, call.Customer.Name&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        select call;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; query.ToList();&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Podéis descargar tanto los binarios como el código fuente desde la &lt;a title="NHibernate Linq project" href="http://sourceforge.net/projects/nhibernate/"&gt;página del proyecto en SourceForge&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-1183914987664047203?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uHDfHZefFXeIvnLnbTPzPAZ2L64/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uHDfHZefFXeIvnLnbTPzPAZ2L64/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uHDfHZefFXeIvnLnbTPzPAZ2L64/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uHDfHZefFXeIvnLnbTPzPAZ2L64/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=a3r6yd7kwYo:G0jeBDbfYCQ:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=a3r6yd7kwYo:G0jeBDbfYCQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=a3r6yd7kwYo:G0jeBDbfYCQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=a3r6yd7kwYo:G0jeBDbfYCQ:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=a3r6yd7kwYo:G0jeBDbfYCQ:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=a3r6yd7kwYo:G0jeBDbfYCQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=a3r6yd7kwYo:G0jeBDbfYCQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=a3r6yd7kwYo:G0jeBDbfYCQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=a3r6yd7kwYo:G0jeBDbfYCQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/a3r6yd7kwYo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/1183914987664047203/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=1183914987664047203" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/1183914987664047203?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/1183914987664047203?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/a3r6yd7kwYo/linq-para-nhibernate-version-10.html" title="Linq para NHibernate, versión 1.0" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/09/linq-para-nhibernate-version-10.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UMRnczfip7ImA9WxNRE0g.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-2968570127061936910</id><published>2009-09-07T22:28:00.000+02:00</published><updated>2009-09-07T22:28:07.986+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-07T22:28:07.986+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="chuletas" /><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="aspnetmvc" /><title>Posters sobre ASP.NET MVC</title><content type="html">&lt;p&gt;&lt;a title="BB&amp;amp;D" href="http://www.bbd.co.za"&gt;BB&amp;amp;D&lt;/a&gt; a través de su iniciativa &lt;a title="Developer Readiness Program" href="http://www.drp.co.za/Home/tabid/37/Default.aspx"&gt;DRP&lt;/a&gt; ha incluido en su ya extenso &lt;a title="Posters" href="http://www.drp.co.za/Posters/tabid/58/Default.aspx"&gt;repositorio de posters&lt;/a&gt; que abarcan innumerables temáticas (arquitectura, modelado, desarrollo, sistemas operativos, etc.), cuatro &lt;a title="Chuletas ASP.NET MVC" href="http://www.drp.co.za/Posters/Development/tabid/67/Default.aspx"&gt;chuletas sobre ASP.NET MVC&lt;/a&gt; a las que vale la pena echarles un vistazo:&lt;/p&gt;  &lt;table border="0" cellspacing="5" cellpadding="2" width="561"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="168"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://lh6.ggpht.com/_O9D62hXq-ng/SqKwCN3LLLI/AAAAAAAABHU/L6NFLfNYcqw/image%5B23%5D.png?imgmax=800" width="161" height="122" /&gt; &lt;/td&gt;        &lt;td valign="top" width="376"&gt;&lt;strong&gt;ASP.NET MVC Framework Cheat Sheet           &lt;br /&gt;&lt;/strong&gt;Información genérica sobre el framework, que incluye la estructura de carpetas de los proyectos de este tipo, la sintaxis del mapeo de rutas, un diagrama del patrón MVC y el ciclo de vida de las peticiones.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="173"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://lh6.ggpht.com/_O9D62hXq-ng/SqKwDBb_65I/AAAAAAAABHY/B9_AePkRm6I/image%5B32%5D.png?imgmax=800" width="161" height="122" /&gt; &lt;/td&gt;        &lt;td valign="top" width="373"&gt;&lt;strong&gt;ASP.NET MVC Controller Cheat Sheet           &lt;br /&gt;&lt;/strong&gt;Muestra los diferentes tipos de ActionResult disponibles, una relación de atributos con sus usos (filtros, selectores de acciones y enlaces de datos), reglas para la definición de métodos de acción&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="176"&gt;&lt;a href="http://lh5.ggpht.com/_O9D62hXq-ng/SqKwJKtGVDI/AAAAAAAABHc/IbWyqNmU26c/s1600-h/image%5B17%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://lh4.ggpht.com/_O9D62hXq-ng/SqKwKcuI8PI/AAAAAAAABHg/3ve7JCoYWC4/image_thumb.png?imgmax=800" width="161" height="122" /&gt;&lt;/a&gt; &lt;/td&gt;        &lt;td valign="top" width="371"&gt;&lt;strong&gt;ASP.NET MVC View Cheat Sheet           &lt;br /&gt;&lt;/strong&gt;Referencia rápida de los helpers &lt;code&gt;Html &lt;/code&gt;y &lt;code&gt;Url&lt;/code&gt;, las directivas de declaración de vistas, y las distintas formas de enviar contenidos al cliente. &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="178"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://lh3.ggpht.com/_O9D62hXq-ng/SqKwL29RYqI/AAAAAAAABHk/BmWFCjaluus/image%5B20%5D.png?imgmax=800" width="161" height="122" /&gt; &lt;/td&gt;        &lt;td valign="top" width="369"&gt;&lt;strong&gt;ASP.NET MVC Proven Practices           &lt;br /&gt;&lt;/strong&gt;Contiene algunos consejos y buenas prácticas al desarrollar una aplicación con el framework.&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Así que ya sabéis, si todavía os queda espacio en la pared y necesitáis tener a mano una referencia rápida de ASP.NET MVC, id preparando impresora y chinchetas ;-)&lt;/p&gt;  &lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-2968570127061936910?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4cHcBIpaAm2pEwSuvHxQOCao9cY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4cHcBIpaAm2pEwSuvHxQOCao9cY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4cHcBIpaAm2pEwSuvHxQOCao9cY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4cHcBIpaAm2pEwSuvHxQOCao9cY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=udJKWROIkdE:JNwhX184pXA:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=udJKWROIkdE:JNwhX184pXA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=udJKWROIkdE:JNwhX184pXA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=udJKWROIkdE:JNwhX184pXA:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=udJKWROIkdE:JNwhX184pXA:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=udJKWROIkdE:JNwhX184pXA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=udJKWROIkdE:JNwhX184pXA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=udJKWROIkdE:JNwhX184pXA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=udJKWROIkdE:JNwhX184pXA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/udJKWROIkdE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/2968570127061936910/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=2968570127061936910" title="1 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/2968570127061936910?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/2968570127061936910?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/udJKWROIkdE/posters-sobre-aspnet-mvc.html" title="Posters sobre ASP.NET MVC" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/09/posters-sobre-aspnet-mvc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4BRn44eSp7ImA9WxNSGUU.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-143541350896103457</id><published>2009-09-02T21:30:00.001+02:00</published><updated>2009-09-03T14:29:17.031+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-03T14:29:17.031+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="novedades" /><category scheme="http://www.blogger.com/atom/ns#" term="noticias" /><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><category scheme="http://www.blogger.com/atom/ns#" term="aspnetmvc" /><title>ASP.NET MVC versión 2, preview 1</title><content type="html">&lt;p&gt;A finales del pasado mes de Julio, &lt;a title="ASP.NET MVC 2 Preview 1 Released" href="http://haacked.com/archive/2009/07/30/asp.net-mvc-released.aspx" hreflang="en"&gt;Haack&lt;/a&gt;, &lt;a title="ASP.NET MVC V2 Preview 1 Released" href="http://weblogs.asp.net/scottgu/archive/2009/07/31/asp-net-mvc-v2-preview-1-released.aspx" hreflang="en"&gt;Scottgu&lt;/a&gt;, y un sinfín de figurillas más, anunciaron la publicación del &lt;a title="Descargar código fuente de ASP.NET MVC 2, preview 1" href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30886"&gt;código fuente&lt;/a&gt; e &lt;a title="Instalador de ASP.NET MVC 2 preview 1" href="http://go.microsoft.com/fwlink/?LinkID=154409"&gt;instaladores&lt;/a&gt; de la primera preview de la nueva versión de la plataforma ASP.NET MVC.&lt;/p&gt;&lt;p&gt;Tal y como se describe en el &lt;a title="Roadmap de ASP.NET MVC" href="http://www.codeplex.com/aspnet/Wiki/View.aspx?title=Road%20Map&amp;amp;referringTitle=Home" hreflang="en"&gt;Roadmap del producto&lt;/a&gt;, el objetivo de la versión 2 es aumentar la productividad de los desarrolladores que trabajen con el framework, así como cubrir determinadas necesidades muy comunes y que no llegaron a introducirse en la primera versión del producto, como las siguientes.&lt;/p&gt;&lt;h4&gt;Soporte para “áreas”&lt;/h4&gt;&lt;p&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px 0px 5px 5px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Soporte para áreas en ASP.NET MVC 2" border="0" alt="Soporte para áreas en ASP.NET MVC 2" align="right" src="http://lh4.ggpht.com/_O9D62hXq-ng/SpbO4bjYn3I/AAAAAAAABGA/d16ULIoItIg/image15.png?imgmax=800" width="123" height="324" /&gt;Las áreas son subproyectos independientes con rutas, vistas y controladores que implementan una sección específica de las funcionalidades de un sistema de forma muy aislada y reutilizable. Ejemplos directos serían un sistema de foros, o un motor de blogs; implementados como áreas, una solución web que necesitara incluir dichas funcionalidades simplemente debería referenciarlas y realizar pequeños ajustes para, a partir de ese momento, poder contar con ellas. &lt;/p&gt;&lt;p&gt;La limpieza del enfoque adoptado favorece la organización, reutilización, el trabajo en equipo y, además, seguro que provoca la aparición de muchos componentes complejos, tanto comerciales como libres, distribuidos de esta forma y listos para ser incluidos en nuestras aplicaciones de forma sencilla. &lt;/p&gt;&lt;p&gt;En cualquier caso, esta primera preview incluye soporte aún muy básico para las áreas, y para utilizarlas hay que tocar a mano los archivos de proyectos (hay un &lt;a title="Paso a paso: Organizar un proyecto usando áreas" href="http://msdn.microsoft.com/en-us/library/ee307987(VS.100).aspx" hreflang="en"&gt;paso a paso en MSDN&lt;/a&gt;&lt;a title="Paso a paso: Organizar un proyecto usando áreas" href="http://msdn.microsoft.com/en-us/library/ee307987(VS.100).aspx"&gt;&lt;/a&gt; que describe cómo hacerlo) . Ya en futuras revisiones se irá introduciendo en el IDE las herramientas para gestionarlas, así como nuevas posibilidades para su integración en un proyecto único.&lt;/p&gt;&lt;h4&gt;Nuevo conjunto de helpers de interfaz de usuario&lt;/h4&gt;&lt;p&gt;Métodos utilizables desde las vistas que seguro que nos harán la vida más fácil al utilizar tipado fuerte para vincular controles de edición y visualización de información a propiedades del modelo, además de permitir el diseño de plantillas para tipos de datos específicos. &lt;/p&gt;&lt;div style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; DIRECTION: ltr; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id="codeSnippet" color="black" size="8pt" face="'Courier New', courier, monospace"&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; DIRECTION: ltr; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="'Courier New', courier, monospace"&gt;En la versión 1 de ASP.NET MVC:&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; DIRECTION: ltr; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="'Courier New', courier, monospace"&gt;&amp;lt;%= Html.TextBox("Nombre", Model.Nombre) %&amp;gt;        &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; DIRECTION: ltr; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;"   &gt; &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; DIRECTION: ltr; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="'Courier New', courier, monospace"&gt;En la versión 2:&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; DIRECTION: ltr; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="'Courier New', courier, monospace"&gt;&amp;lt;%= Html.EditorFor(persona=&amp;gt;persona.Nombre) %&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Fijaos que desaparecen los nombres mágicos (constantes entrecomilladas) necesarios en la versión 1 para generar los controles de edición, y pasan a ser &lt;a href="http://www.variablenotfound.com/2009/03/c-desmitificando-las-expresiones-lambda.html"&gt;expresiones lambda&lt;/a&gt; que referencian directamente a la propiedad del modelo, por lo que se podría &lt;a title="Compilar vistas en ASP.NET MVC" href="http://www.variablenotfound.com/2009/05/compilar-las-vistas-en-aspnet-mvc.html"&gt;comprobar su corrección en tiempo de compilación&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px 0px 5px 5px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="EditFor() con un tipo complejo" border="0" alt="EditFor() con un tipo complejo" align="right" src="http://lh6.ggpht.com/_O9D62hXq-ng/SpbO42FE0AI/AAAAAAAABGE/i7aNwlHwgF8/image%5B3%5D.png?imgmax=800" width="198" height="153" /&gt;Pero &lt;code&gt;Html.EditorFor()&lt;/code&gt; no sólo es aplicable a tipos “nativos”, también pueden ser estructuras complejas (por ejemplo, la clase &lt;code&gt;Persona&lt;/code&gt;), para las que generará por defecto los controles de edición de todas sus propiedades, salvo aquellas en las que se haya indicado expresamente lo contrario. Esto, que en escenarios simples puede resultar suficiente para crear formularios de edición de datos, se realizaría haciendo que la lambda devuelva el propio objeto del modelo: &lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;&lt;div style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; DIRECTION: ltr; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;" id="codeSnippet"   &gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; DIRECTION: ltr; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="'Courier New', courier, monospace"&gt;&amp;lt;% &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (Html.BeginForm()) { %&amp;gt;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; DIRECTION: ltr; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="'Courier New', courier, monospace"&gt;    &amp;lt;%= Html.EditorFor(persona=&amp;gt;persona) %&amp;gt;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;    &amp;lt;&lt;span style="color:#0000ff;"&gt;input&lt;/span&gt; type="submit" &lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;="Enviar" /&amp;gt;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; DIRECTION: ltr; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="'Courier New', courier, monospace"&gt;&amp;lt;% } %&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Internamente, &lt;code&gt;Html.EditorFor()&lt;/code&gt; buscará antes de renderizar ningún resultado HTML si existe una plantilla de edición para el tipo de datos devuelto por la lambda en la carpeta &lt;code&gt;Views\Shared\EditorTemplates&lt;/code&gt;, con el nombre &lt;code&gt;NombreDelTipo.ascx&lt;/code&gt; (por ejemplo &lt;code&gt;Persona.ascx&lt;/code&gt;). También es posible indicarle explícitamente la plantilla que debe usar para renderizar el editor, tanto en el momento de invocar al helper como a nivel de la propia clase del modelo. &lt;/p&gt;&lt;p&gt;Todo lo dicho hasta ahora es válido para la visualización de datos, que utilizará el helper &lt;code&gt;Html.DisplayFor()&lt;/code&gt;: de la misma forma, los parámetros fuertemente tipados del método nos ayudarán a detectar errores en fase de compilación, y existe igualmente la posibilidad de definir las plantillas, aunque la carpeta donde se habrán de colocar debe ser en esta ocasión &lt;code&gt;Views\Shared\DisplayTemplates.&lt;/code&gt; Hay un buen paso a paso, aunque en inglés, de cómo &lt;a title="Walkthrough: Using Templated Helpers to Display Data" href="http://msdn.microsoft.com/en-us/library/ee308450(VS.100).aspx" hreflang="en"&gt;utilizar este tipo de plantillas&lt;/a&gt;&lt;a title="Walkthrough: Using Templated Helpers to Display Data" href="http://msdn.microsoft.com/en-us/library/ee308450(VS.100).aspx"&gt;&lt;/a&gt;. &lt;/p&gt;&lt;p&gt;Un último helper más, &lt;code&gt;LabelFor()&lt;/code&gt;, está especialmente creado para generar etiquetas asociadas a controles de edición. Su principal particularidad es que es capaz de tomar la descripción del campo desde los metadatos de la clase del modelo. Esta técnica es la misma que utiliza otra de las grandes novedades de esta versión, el sistema de validación.&lt;/p&gt;&lt;h4&gt;Mecanismo de validación integrado&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;Ese gran ausente en la primera versión del framework MVC que hacía que tuviéramos que encargarnos a mano de comprobar uno por uno los datos de entrada (o utilizar frameworks externos) para que no se colara en el modelo información inválida. La solución viene de mano de las &lt;a title="System.ComponentModel.DataAnnotations (Espacio de nombres) ()" href="http://msdn.microsoft.com/es-es/library/system.componentmodel.dataannotations.aspx"&gt;Data Annotations&lt;/a&gt;, un conjunto de atributos que podemos aplicar a las entidades de datos para indicar restricciones aplicables a sus valores: &lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;&lt;div style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id="codeSnippet"&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; Persona&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;{&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;    [DisplayName(&lt;span style="color:#006080;"&gt;"Nombre"&lt;/span&gt;)]&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;    [Required(ErrorMessage = &lt;span style="color:#006080;"&gt;"El nombre es obligatorio!"&lt;/span&gt;)]&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;    [StringLength(45)]&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; Nombre { get; set; }&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt; &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;    [DisplayName(&lt;span style="color:#006080;"&gt;"Número de hijos"&lt;/span&gt;)]&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;    [Range(0, 15)]&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; NumeroDeHijos { get; set; }&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;En el ejemplo anterior vemos un caso simple en el hemos añadido metadatos a la clase del modelo que describen las particularidades de cada propiedad. ASP.NET MVC Framework versión 2 es capaz de obtener esta información y utilizarla para validar la entrada de datos al recibir un formulario, o incluso en cliente por obra y gracia de un plugin para jQuery que será incluido en la plantilla, aunque esto todavía no está disponible en esta preview.&lt;/p&gt;&lt;p&gt;Un detalle interesante a tener en cuenta es que, dado que las clases de datos son habitualmente generadas por herramientas automáticas, estos los metadatos pueden ser definidos en clases paralelas (clases ‘buddy’). Una solución un poco anti-&lt;a title="No te repitas" href="http://es.wikipedia.org/wiki/No_te_repitas"&gt;DRY&lt;/a&gt;, pero bueno…&lt;/p&gt;&lt;h4&gt;Otras mejoras&lt;/h4&gt;&lt;p&gt;Hay otras mejoras de menor calado aunque también interesantes, como la inclusión del nuevo atributo &lt;code&gt;[HttpPost]&lt;/code&gt; para acelerar la declaración de acciones restringidas a ese método del protocolo, el soporte para valores por defecto en parámetros (basado en atributos hasta que llegue el nuevo C# 4.0, aunque ya disponible en VB), o algunos cambios en el API (algunos de ellos “rompedores”). Todos estos detalles pueden consultarse en el documento de &lt;a title="Descargar el documento de notas de la revisión" href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=d34f9eaa-fcbe-4e20-b2fd-a9a03de7d6dd" hreflang="en"&gt;notas de la revisión&lt;/a&gt;&lt;a title="Descargar el documento de notas de la revisión" href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=d34f9eaa-fcbe-4e20-b2fd-a9a03de7d6dd"&gt;&lt;/a&gt;. &lt;/p&gt;&lt;p&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px 0px 5px 5px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="ASP.NET MVC 1 y 2 al mismo tiempo, vamos a llevarnos bien..." border="0" alt="ASP.NET MVC 1 y 2 al mismo tiempo, vamos a llevarnos bien..." align="right" src="http://lh4.ggpht.com/_O9D62hXq-ng/SpbO6H65QQI/AAAAAAAABGI/hAMXSS3PFjE/image16.png?imgmax=800" width="392" height="224" /&gt;Si quieres ir probando en persona las novedades, puedes &lt;a title="Instalador de ASP.NET MVC 2 preview 1" href="http://go.microsoft.com/fwlink/?LinkID=154409"&gt;descargar la preview&lt;/a&gt; y jugar con ella desde Visual Studio 2008 SP1 (también funciona para &lt;a title="Descargar VWD 2008 SP1" href="http://www.microsoft.com/express/vwd/"&gt;Visual Web Developer Express 2008 SP1&lt;/a&gt;, el IDE gratuito) sin peligro alguno. El instalable en ningún momento sobrescribe librerías o componentes de la versión 1.0, sólo creará un nuevo juego de plantillas para esta versión. Eso sí, si eres de los afortunados que están ya exprimiendo la beta 1 de VS2010, has de saber que no son compatibles, tendrás que esperar hasta la beta 2, la cual ya incluirá la próxima preview del framework.&lt;/p&gt;&lt;p&gt;Seguiremos atentos a la evolución del framework, que estos muchachos están que no paran…&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-143541350896103457?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DdD990uEBlp6WcccvY1SjRvKmqE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DdD990uEBlp6WcccvY1SjRvKmqE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DdD990uEBlp6WcccvY1SjRvKmqE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DdD990uEBlp6WcccvY1SjRvKmqE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=Xlig-pOThiA:PKgHU3dHW9o:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=Xlig-pOThiA:PKgHU3dHW9o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=Xlig-pOThiA:PKgHU3dHW9o:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=Xlig-pOThiA:PKgHU3dHW9o:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=Xlig-pOThiA:PKgHU3dHW9o:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=Xlig-pOThiA:PKgHU3dHW9o:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=Xlig-pOThiA:PKgHU3dHW9o:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=Xlig-pOThiA:PKgHU3dHW9o:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=Xlig-pOThiA:PKgHU3dHW9o:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/Xlig-pOThiA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/143541350896103457/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=143541350896103457" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/143541350896103457?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/143541350896103457?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/Xlig-pOThiA/aspnet-mvc-version-2-preview-1.html" title="ASP.NET MVC versión 2, preview 1" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/09/aspnet-mvc-version-2-preview-1.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4EQX86fSp7ImA9WxNSF0g.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-2537229725318840839</id><published>2009-09-01T00:15:00.001+02:00</published><updated>2009-09-01T00:15:00.115+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-01T00:15:00.115+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="frameworks" /><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="libros" /><category scheme="http://www.blogger.com/atom/ns#" term="personal" /><category scheme="http://www.blogger.com/atom/ns#" term="aspnetmvc" /><category scheme="http://www.blogger.com/atom/ns#" term="blogging" /><category scheme="http://www.blogger.com/atom/ns#" term="vacaciones" /><title>De vuelta</title><content type="html">&lt;p&gt;Pues sí… todo lo que empieza acaba, y las vacaciones no iban a ser una alegre excepción. &lt;/p&gt;  &lt;p&gt;Aquí estamos de nuevo listos para entrar en combate. Esta vez, además, el retorno al &lt;a title="MundoReal™ en Microsiervos" href="http://www.microsiervos.com/archivo/mundoreal/"&gt;MundoReal™&lt;/a&gt; coindice con un momento de emocionantes cambios a nivel profesional, lo cual hace especialmente motivador el regreso.&lt;/p&gt;  &lt;p&gt;En cuanto a las vas vacaciones, simplemente geniales: mucho descanso en las playas de Huelva y Cádiz y, sobre todo, un grato recuerdo de la visita a &lt;a title="Lanzarote" href="http://maps.google.es/maps?f=q&amp;amp;source=s_q&amp;amp;hl=es&amp;amp;geocode=&amp;amp;q=lanzarote&amp;amp;ie=UTF8&amp;amp;t=h&amp;amp;z=11" target="_blank"&gt;Lanzarote&lt;/a&gt;, que sin duda es espectacular; si alguna vez tenéis oportunidad de visitar la isla, no dudéis en ir a disfrutar de ese lugar &lt;em&gt;tan diferente&lt;/em&gt;. La única pega ha sido la insistente ola de calor que nos ha perseguido a todos nuestros destinos, pero bueno, son &lt;a title="Gajes del oficio, según la RAE" href="http://buscon.rae.es/draeI/SrvltConsulta?TIPO_BUS=3&amp;amp;LEMA=gajes" target="_blank"&gt;gajes del oficio&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 5px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Struts 2 in action, en Amazon.com" border="0" alt="Struts 2 in action, en Amazon.com" align="right" src="http://lh6.ggpht.com/_O9D62hXq-ng/SpfWSEGK6rI/AAAAAAAABGM/Fdn_hci8qWY/image%5B3%5D.png?imgmax=800" width="147" height="183" /&gt; De compañero de viaje esta vez he elegido &lt;a title="Struts 2 in action" href="http://www.amazon.com/gp/product/193398807X?ie=UTF8&amp;amp;tag=variabnotfoun-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=193398807X" target="_blank"&gt;Struts 2 in action&lt;/a&gt;, una muy recomendable lectura para conocer este veterano &lt;a title="Struts 2 Homepage" href="http://struts.apache.org/2.x/index.html" title="Struts 2 Homepage"  hreflang="en"&gt;framework Java&lt;/a&gt; de desarrollo de aplicaciones web bajo la filosofía MVC. Me ha resultado interesantísimo conocer el enfoque del marco de trabajo, y contrastarlo con el muy reciente &lt;a title="Sitio oficial de ASP.NET" href="http://www.asp.net/mvc/" hreflang="en" target="_blank"&gt;ASP.NET MVC&lt;/a&gt;&lt;a title="Sitio oficial de ASP.NET" href="http://www.asp.net/mvc/" target="_blank"&gt;&lt;/a&gt;; aunque con las obvias diferencias vinculadas a las tecnologías subyacentes en cada caso y al nombrado de componentes, hay muchísimas coincidencias y es sencillo encontrar correspondencias entre ambos frameworks que facilitan la comprensión y asimilación de los conceptos.&lt;/p&gt;  &lt;p&gt;El libro está editado en español por Anaya Multimedia, bajo el nombre &lt;a title="Struts 2, en Anaya Multimedia" href="http://www.anayamultimedia.es/cgigeneral/ficha.pl?id_sello_editorial_web=23&amp;amp;codigo_comercial=2327704" target="_blank"&gt;Struts 2&lt;/a&gt;; aunque, como suele ocurrir en este tipo de textos, de vez en cuando te encuentras errores de traducción y contenidos, cumple bastante bien su cometido.&lt;/p&gt;  &lt;p&gt;Y sin más preámbulos, comenzamos la temporada 2009-10 en &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;, donde espero seguir contando, como hasta ahora, con vuestra participación y apoyo. &lt;/p&gt;  &lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-2537229725318840839?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jcuV_9BQuWWrZPh5TCbg0yZbThs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jcuV_9BQuWWrZPh5TCbg0yZbThs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jcuV_9BQuWWrZPh5TCbg0yZbThs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jcuV_9BQuWWrZPh5TCbg0yZbThs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=WN2ReHbQVFg:Uynqfc011fc:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=WN2ReHbQVFg:Uynqfc011fc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=WN2ReHbQVFg:Uynqfc011fc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=WN2ReHbQVFg:Uynqfc011fc:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=WN2ReHbQVFg:Uynqfc011fc:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=WN2ReHbQVFg:Uynqfc011fc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=WN2ReHbQVFg:Uynqfc011fc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=WN2ReHbQVFg:Uynqfc011fc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=WN2ReHbQVFg:Uynqfc011fc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/WN2ReHbQVFg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/2537229725318840839/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=2537229725318840839" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/2537229725318840839?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/2537229725318840839?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/WN2ReHbQVFg/de-vuelta.html" title="De vuelta" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/09/de-vuelta.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEAQXo4eSp7ImA9WxJbFkk.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-8230963641695547686</id><published>2009-07-26T23:44:00.001+02:00</published><updated>2009-07-26T23:44:00.431+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-26T23:44:00.431+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="personal" /><category scheme="http://www.blogger.com/atom/ns#" term="blogging" /><category scheme="http://www.blogger.com/atom/ns#" term="vacaciones" /><title>De descanso</title><content type="html">&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 5px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Lanzarote" border="0" alt="Lanzarote" align="right" src="http://lh3.ggpht.com/_O9D62hXq-ng/SmSd1a8leYI/AAAAAAAABF0/V7hmp7QBBZM/image%5B3%5D.png?imgmax=800" width="177" height="133" /&gt; Tras un año duro (¡muy duro!), llegan de nuevo las vacaciones: tiempo de descansar un poco, disfrutar con la familia, formatearse mentalmente y recargar las pilas con vistas a comenzar un nuevo periodo tras el verano. Y todo ello alternando entre &lt;a title="Sanlúcar de Barrameda" href="http://www.aytosanlucar.org/index.asp?p=6683&amp;amp;c=4670c07872d5314c6ad6ffa633d4a059"&gt;Sanlúcar de Barrameda&lt;/a&gt;, &lt;a title="El Portil" href="http://www.playasdehuelva.com/turismo/playas/puntaumbria/elportil.html"&gt;El Portil&lt;/a&gt;, y una escapada a &lt;a title="Lanzarote" href="http://www.turismolanzarote.com"&gt;Lanzarote&lt;/a&gt; que seguro que será una delicia. No me puedo quejar, la verdad.&lt;/p&gt;  &lt;p&gt;&lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable Not Found&lt;/a&gt; quedará, una vez más, a la deriva hasta que regrese dentro de unas semanas. Además, para evitar que los &lt;em&gt;spammers&lt;/em&gt; se vengan a vivir aquí, desactivaré temporalmente el envío de comentarios anónimos, lamento las molestias que pueda causar.&lt;/p&gt;  &lt;p&gt;Feliz verano, amigos. :-)&lt;/p&gt;&lt;p&gt;Publicado en: &lt;a href="http://www.variablenotfound.com"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-8230963641695547686?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AGNr2X-rjnFcADeNg722keEpswY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AGNr2X-rjnFcADeNg722keEpswY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AGNr2X-rjnFcADeNg722keEpswY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AGNr2X-rjnFcADeNg722keEpswY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=YcnEFLdgwPw:kzTOqxRRCzk:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=YcnEFLdgwPw:kzTOqxRRCzk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=YcnEFLdgwPw:kzTOqxRRCzk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=YcnEFLdgwPw:kzTOqxRRCzk:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=YcnEFLdgwPw:kzTOqxRRCzk:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=YcnEFLdgwPw:kzTOqxRRCzk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=YcnEFLdgwPw:kzTOqxRRCzk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=YcnEFLdgwPw:kzTOqxRRCzk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=YcnEFLdgwPw:kzTOqxRRCzk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/YcnEFLdgwPw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/8230963641695547686/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=8230963641695547686" title="3 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/8230963641695547686?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/8230963641695547686?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/YcnEFLdgwPw/de-descanso.html" title="De descanso" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/07/de-descanso.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcGQX0zcCp7ImA9WxJbEU8.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-8199598719375474559</id><published>2009-07-20T23:57:00.000+02:00</published><updated>2009-07-20T23:57:00.388+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-20T23:57:00.388+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".net" /><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><category scheme="http://www.blogger.com/atom/ns#" term="trucos" /><category scheme="http://www.blogger.com/atom/ns#" term="depuración" /><title>Métodos condicionales en .NET</title><content type="html">&lt;a href="http://2.bp.blogspot.com/_O9D62hXq-ng/SmSTrJ6rBuI/AAAAAAAABFs/t8GxkLm2gSs/s1600-h/programacion.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 197px; height: 248px;" src="http://2.bp.blogspot.com/_O9D62hXq-ng/SmSTrJ6rBuI/AAAAAAAABFs/t8GxkLm2gSs/s400/programacion.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5360571826083399394" /&gt;&lt;/a&gt;&lt;p&gt;En la plataforma .NET existen distintas formas de hacer que una llamada a un método sea omitida bajo determinadas circunstancias. Por ejemplo, los &lt;a href="http://www.variablenotfound.com/2008/04/mtodos-parciales-en-c-3-y-vbnet-9.html"&gt;métodos parciales&lt;/a&gt; permiten, en C# 3.0 y VB 9.0, que el compilador omita la llamada a funciones no implementadas. También existe la posibilidad de utilizar las clásicas directivas (como &lt;code&gt;#&lt;font color="#0000ff"&gt;if&lt;/font&gt;… #&lt;font color="#0000ff"&gt;endif&lt;/font&gt;&lt;/code&gt; ) para incluir código cuando existan constantes de compilación.&lt;/p&gt;  &lt;p&gt;Es menos conocida, sin embargo, la existencia del atributo &lt;code&gt;&lt;a title="Conditional Attribute" href="http://msdn.microsoft.com/es-es/library/system.diagnostics.conditionalattribute.aspx"&gt;ConditionalAttribute&lt;/a&gt;&lt;/code&gt;, que aplicado a un método hace que las llamadas a éste no sean incluidas en el ensamblado si no existe la constante de compilación cuyo nombre se indica en el parámetro.&lt;/p&gt;  &lt;p&gt;Por ejemplo, explorando un poco el espacio de nombres &lt;code&gt;System.Diagnostics&lt;/code&gt;, vemos que todos los métodos de la clase &lt;code&gt;Debug&lt;/code&gt;, están adornados por este atributo así:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; [Conditional(&lt;span style="color: #006080"&gt;&amp;quot;DEBUG&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; WriteLine(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; message)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     TraceInternal.WriteLine(message);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Ahora, imaginad que tenemos un código que usa esta clase, por ejemplo de la siguiente manera:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Main(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] args)&lt;/pre&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;for&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i=0; i &amp;lt; 1000; i++)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         Debug.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;Iteración &amp;quot;&lt;/span&gt; + i);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         ProcesaAlgoComplejo(i);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; j = ProcesaOtraCosa(i);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;         Debug.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;Obtenido &amp;quot;&lt;/span&gt; + j);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// ...&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Si compilamos en modo “debug” (o simplemente está definida la constante de compilación con dicho nombre), las llamadas a estos métodos serán omitidas en el ensamblado resultante, por lo que el código finalmente generado será totalmente equivalente a:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Main(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] args)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;for&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i=0; i &amp;lt; 1000; i++)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         ProcesaAlgoComplejo(i);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; j = ProcesaOtraCosa(i);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// ...&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Pero ojo, que se omiten tanto las llamadas al método como la evaluación de sus parámetros, y esto puede provocar errores difíciles de detectar. Por ejemplo, el siguiente código daría lugar a un bucle infinito de los de toda la vida ;-) si compilamos en modo “release”; sin embargo, compilando en “debug” funcionaría correctamente:&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; j = 0;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;while&lt;/span&gt; (j &amp;lt; 100)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     Console.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;Hey &amp;quot;&lt;/span&gt; + j);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     Debug.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;Procesado &amp;quot;&lt;/span&gt; + (j++));  &lt;span style="color: #008000"&gt;// &amp;lt;-- Esta línea desaparece cuando&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;                                             &lt;span style="color: #008000"&gt;//     compilamos en modo release!&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Aunque en el anterior ejemplo estamos jugando con la constante predefinida &lt;code&gt;DEBUG&lt;/code&gt;, este atributo podemos utilizarlo con otras constantes, tanto existentes como personalizadas. Como muestra, podéis echar un vistazo a la definición de la clase &lt;code&gt;System.Diagnostics.Trace&lt;/code&gt;, que vincula el uso de sus métodos a la existencia de la constante &lt;code&gt;TRACE&lt;/code&gt;:&lt;/p&gt;&lt;br /&gt;&lt;div id="codeSnippetWrapper"&gt;  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;sealed&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Trace&lt;/pre&gt;&lt;!--CRLF--&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// ...&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; Trace();&lt;/pre&gt;&lt;!--CRLF--&gt; &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     [Conditional(&lt;span style="color: #006080"&gt;&amp;quot;TRACE&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Assert(&lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; condition);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     [Conditional(&lt;span style="color: #006080"&gt;&amp;quot;TRACE&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Assert(&lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; condition, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; message);&lt;/pre&gt;&lt;!--CRLF--&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     [Conditional(&lt;span style="color: #006080"&gt;&amp;quot;TRACE&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Assert(&lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; condition, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; message, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; detailMessage);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;     [Conditional(&lt;span style="color: #006080"&gt;&amp;quot;TRACE&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Close();&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;     [Conditional(&lt;span style="color: #006080"&gt;&amp;quot;TRACE&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Fail(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; message);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;     [Conditional(&lt;span style="color: #006080"&gt;&amp;quot;TRACE&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Fail(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; message, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; detailMessage);&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;     [Conditional(&lt;span style="color: #006080"&gt;&amp;quot;TRACE&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Flush();&lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;     [Conditional(&lt;span style="color: #006080"&gt;&amp;quot;TRACE&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;     &lt;span style="color: #008000"&gt;//...&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Si vais a utilizar el atributo sobre vuestros métodos, condicionándolos a la existencia de constantes de compilación personalizadas, recordad que las constantes podéis definirlas:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;desde las propiedades del proyecto en el IDE&lt;/li&gt;&lt;li&gt;en la línea de comandos del compilador (por ejemplo, &lt;code&gt;/define:LOG&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;variables de entorno del sistema operativo (&lt;code&gt;set LOG=1&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;en directivas sobre vuestro propio código (directiva &lt;code&gt;#define LOG&lt;/code&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Eso sí, tened en cuenta que &lt;strong&gt;el método siempre será compilado e introducido en el ensamblado&lt;/strong&gt;, son las invocaciones a éste las que son omitidas en caso de no existir la constante indicada.&lt;/p&gt;&lt;p&gt;Hay que tener en cuenta las siguientes observaciones para el uso del atributo &lt;code&gt;Conditional&lt;/code&gt;:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Los métodos a los que se aplica no pueden tener tipo de retorno, es decir, serán &lt;code&gt;void&lt;/code&gt;. Esto tiene bastante sentido, si pensamos en los efectos laterales que podría causar la desaparición de una invocación tras la cual se haga uso del valor retornado.&lt;/li&gt;&lt;li&gt;Sólo se pueden aplicar a métodos en clases o estructuras. Nada de interfaces (¡tampoco tendría mucho sentido!).&lt;/li&gt;&lt;li&gt;Si un método virtual está marcado como &lt;code&gt;Conditional&lt;/code&gt;, las reescrituras de éste realizadas desde clases descendientes también lo estarán.&amp;#160; Es bastante lógico, puesto que así se mantienen las dependencias íntegras.&lt;/li&gt;&lt;li&gt;Si el atributo se aplica a un método, éste no puede ser un reemplazo del comportamiento de un antecesor (o sea, que no puede ser un &lt;em&gt;override&lt;/em&gt;). También resulta muy lógico.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;En resumen, se trata de un buen método para incluir código condicional en nuestros desarrollos, dependiente del contexto de compilación, evitando tener que usar directivas &lt;code&gt;#&lt;font color="#0000ff"&gt;if&lt;/font&gt;… #&lt;font color="#0000ff"&gt;endif&lt;/font&gt;&lt;/code&gt;. Pero no lo olvidéis: cuidado con los efectos laterales citados.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Publicado en: &lt;a title="Variable Not Found" href="http://www.variablenotfound.com/"&gt;Variable not found&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27752126-8199598719375474559?l=www.variablenotfound.com'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Gy6sF17xxAvoCRGo258fjjRO5K8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Gy6sF17xxAvoCRGo258fjjRO5K8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Gy6sF17xxAvoCRGo258fjjRO5K8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Gy6sF17xxAvoCRGo258fjjRO5K8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/vnf?a=Sg_GqzE1vFY:er1l7iS4p48:ecdYMiMMAMM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=ecdYMiMMAMM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=Sg_GqzE1vFY:er1l7iS4p48:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=Sg_GqzE1vFY:er1l7iS4p48:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=Sg_GqzE1vFY:er1l7iS4p48:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=Sg_GqzE1vFY:er1l7iS4p48:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=Sg_GqzE1vFY:er1l7iS4p48:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=Sg_GqzE1vFY:er1l7iS4p48:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/vnf?a=Sg_GqzE1vFY:er1l7iS4p48:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/vnf?i=Sg_GqzE1vFY:er1l7iS4p48:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vnf/~4/Sg_GqzE1vFY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.variablenotfound.com/feeds/8199598719375474559/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27752126&amp;postID=8199598719375474559" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/8199598719375474559?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27752126/posts/default/8199598719375474559?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vnf/~3/Sg_GqzE1vFY/metodos-condicionales-en-net.html" title="Métodos condicionales en .NET" /><author><name>José M. Aguilar</name><uri>http://www.blogger.com/profile/11683750380776435448</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="13204222613663593069" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_O9D62hXq-ng/SmSTrJ6rBuI/AAAAAAAABFs/t8GxkLm2gSs/s72-c/programacion.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.variablenotfound.com/2009/07/metodos-condicionales-en-net.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4EQXo_fCp7ImA9WxJUFk0.&quot;"><id>tag:blogger.com,1999:blog-27752126.post-6906177568692371768</id><published>2009-07-14T23:45:00.001+02:00</published><updated>2009-07-14T23:45:00.444+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-14T23:45:00.444+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".net" /><category scheme="http://www.blogger.com/atom/ns#" term="desarrollo" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><category scheme="http://www.blogger.com/atom/ns#" term="trucos" /><title>Generación de PDF desde .NET usando formularios</title><content type="html">&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 5px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Formulario PDF" border="0" alt="Formulario PDF" align="right" src="http://lh5.ggpht.com/_O9D62hXq-ng/SkpjiybrUxI/AAAAAAAABFg/7AWqDbMnKAU/image3.png?imgmax=800" width="198" height="235" /&gt;Un post en &lt;a title="iTextSharp – The easy way" href="http://blog.dmbcllc.com/2009/06/24/itextsharp-the-easy-way/"&gt;.NET Answers&lt;/a&gt; me ha recordado que hace tiempo tenía pendiente escribir una entrada para comentar la técnica que he utilizado en más de una ocasión para generar documentos PDF desde mis aplicaciones .NET de forma muy sencilla, y que puede aplicarse en escenarios donde se conozca de antemano el diseño del documento a imprimir y sólo sea necesario introducir información concreta en espacios muy definidos. Un caso muy habitual es el rellenado de formularios o impresos, aunque usando un poco la imaginación seguro que podéis encontrarle muchas más utilidades.&lt;/p&gt;  &lt;p&gt;La técnica consiste en crear, utilizando alguna herramienta de diseño como &lt;a title="Adobe Acrobat" href="http://tryit.adobe.com/es/acrobat9/?sdid=DEUPA"&gt;Adobe Acrobat&lt;/a&gt;, un documento PDF que contenga todos los contenidos estáticos del documento que deseamos generar. En cada zona donde queremos &lt;em&gt;inyectar&lt;/em&gt; contenido deberemos introducir un campo de formulario (por ejemplo, “nombre”, “apellidos”, etc.) adaptando el tipo de letra, límites y las propiedades del campo que sean necesarias.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Referencias del proyecto" border="0" alt="image" align="right" src="http://lh5.ggpht.com/_O9D62hXq-ng/SkpjjX299UI/AAAAAAAABFk/7q3CTu1cNL8/image6.png?imgmax=800" width="145" height="122" /&gt;Ya desde código el procedimiento será bien sencillo: abrimos la plantilla, introducimos los valores en cada uno de los campos, y hacemos con el documento resultante lo que nos convenga según la ocasión: enviarlo por email, salvarlo a disco, ofrecerlo para la descarga, etc.&lt;/p&gt;  &lt;p&gt;Para conseguir estos objetivos utilizaremos &lt;a title="iTextSharp" href="http://sourceforge.net/projects/itextsharp/"&gt;iTextSharp&lt;/a&gt;, una adaptación para .NET de la librería &lt;a title="iText" href="http://www.lowagie.com/iText/"&gt;iText&lt;/a&gt;, muy conocida en el mundo Java. Por tanto, en primer lugar, es necesario descargarla desde &lt;a title="Descargar iTextSharp" href="http://sourceforge.net/project/platformdownload.php?group_id=72954"&gt;Sourceforge&lt;/a&gt;, y referenciarla en el proyecto desde el cual vamos a utilizarla. &lt;/p&gt;  &lt;p&gt;El siguiente código implementa un método realiza el procedimiento descrito:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public &lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt; FillPDF(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; templateFile, Stream stream)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// Abrimos la plantilla y creamos una copia, sobre&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// la cual trabajaremos...&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     PdfReader reader = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PdfReader(templateFile);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     PdfStamper stamp = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PdfStamper(reader, stream);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// Introducimos el valor en los campos del formulario...&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     stamp.AcroFields.SetField(&lt;span style="color: #006080"&gt;&amp;quot;Nombre&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Juan&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; b