<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>ASP.NET</title><link>http://blogs.clearscreen.com/ragc/category/36.aspx</link><description>ASP.NET</description><managingEditor>Raúl Alarcón García-Cuevas</managingEditor><dc:language>es-ES</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>Raúl Alarcón García-Cuevas</dc:creator><title>Writing Secure ASP.NET applications</title><link>http://blogs.clearscreen.com/ragc/archive/2005/07/06/2195.aspx</link><pubDate>Wed, 06 Jul 2005 09:54:00 GMT</pubDate><guid>http://blogs.clearscreen.com/ragc/archive/2005/07/06/2195.aspx</guid><wfw:comment>http://blogs.clearscreen.com/ragc/comments/2195.aspx</wfw:comment><comments>http://blogs.clearscreen.com/ragc/archive/2005/07/06/2195.aspx#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/ragc/comments/commentRss/2195.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/ragc/services/trackbacks/2195.aspx</trackback:ping><description>&lt;p&gt;I just have read a post from &lt;span class="siteName"&gt;&lt;a href="http://www.securecoder.com/blog/default.aspx"&gt;Anil John&lt;/a&gt; blog who referees to four articles from &lt;a href="http://msdn.microsoft.com/practices/"&gt;Msdn Patterns and Practices&lt;/a&gt; about techniques to avoid common attacks to web applications:&lt;/span&gt;&lt;/p&gt;&lt;span class="siteName"&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000003.asp"&gt;&lt;font color="#0000cc"&gt;How To-Protect from Injection Attacks in ASPNET&lt;/font&gt;&lt;/a&gt; 
&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000001.asp"&gt;&lt;font color="#0000cc"&gt;How To-Use Regular Expressions to Constrain Input in ASP.NET&lt;/font&gt;&lt;/a&gt; 
&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000002.asp"&gt;&lt;font color="#0000cc"&gt;How To-Protect from SQL Injection in ASP.NET&lt;/font&gt;&lt;/a&gt; 
&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000004.asp"&gt;&lt;font color="#0000cc"&gt;How To-Prevent Cross-Site Scripting in ASP.NET&lt;/font&gt;&lt;/a&gt; 
&lt;p&gt;Very interesting information for every body who deals with .NET web application development.&lt;/p&gt;&lt;/li&gt;&lt;/span&gt;&lt;img src ="http://blogs.clearscreen.com/ragc/aggbug/2195.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>I just have read a post from <span class="siteName"><a href="http://www.securecoder.com/blog/default.aspx">Anil John</a> blog who referees to four articles from <a href="http://msdn.microsoft.com/practices/">Msdn Patterns and Practices</a> about techniques to avoid common attacks to web applications:</span></p><span class="siteName">
<li><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000003.asp"><font color="#0000cc">How To-Protect from Injection Attacks in ASPNET</font></a> 
</li><li><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000001.asp"><font color="#0000cc">How To-Use Regular Expressions to Constrain Input in ASP.NET</font></a> 
</li><li><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000002.asp"><font color="#0000cc">How To-Protect from SQL Injection in ASP.NET</font></a> 
</li><li><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000004.asp"><font color="#0000cc">How To-Prevent Cross-Site Scripting in ASP.NET</font></a> 
<p>Very interesting information for every body who deals with .NET web application development.</p></li></span><img src ="http://blogs.clearscreen.com/ragc/aggbug/2195.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Raúl Alarcón García-Cuevas</dc:creator><title>.NET Exception Handling</title><link>http://blogs.clearscreen.com/ragc/archive/2005/02/23/1083.aspx</link><pubDate>Wed, 23 Feb 2005 10:14:00 GMT</pubDate><guid>http://blogs.clearscreen.com/ragc/archive/2005/02/23/1083.aspx</guid><wfw:comment>http://blogs.clearscreen.com/ragc/comments/1083.aspx</wfw:comment><comments>http://blogs.clearscreen.com/ragc/archive/2005/02/23/1083.aspx#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/ragc/comments/commentRss/1083.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/ragc/services/trackbacks/1083.aspx</trackback:ping><description>&lt;p&gt;&lt;a href="http://www.codeproject.com/dotnet/exceptionbestpractices.asp" target="_blank"&gt;Here&lt;/a&gt; is an article, from "The Code Project" factory, about best practices for exception handling in .NET. The article covers all aspects about this matter, sometimes risky when we are writing code. Everybody knows that exception handling is one of the &lt;span&gt;mechanism provided by high level languages with which coders must deal daily, in my opinion, only the forty percent of the wrote code is related with the logic of the problem, the other sixty percent is wrote to control errors and exceptions, this is the importance of exception handling!.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Enjoy the article!&lt;/span&gt;&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/ragc/aggbug/1083.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p><a href="http://www.codeproject.com/dotnet/exceptionbestpractices.asp" target="_blank">Here</a> is an article, from "The Code Project" factory, about best practices for exception handling in .NET. The article covers all aspects about this matter, sometimes risky when we are writing code. Everybody knows that exception handling is one of the <span>mechanism provided by high level languages with which coders must deal daily, in my opinion, only the forty percent of the wrote code is related with the logic of the problem, the other sixty percent is wrote to control errors and exceptions, this is the importance of exception handling!.</span></p>
<p><span>Enjoy the article!</span></p><img src ="http://blogs.clearscreen.com/ragc/aggbug/1083.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Raúl Alarcón García-Cuevas</dc:creator><title>ASP.NET Error: The server tag is not well formed</title><link>http://blogs.clearscreen.com/ragc/archive/2004/10/28/525.aspx</link><pubDate>Thu, 28 Oct 2004 15:21:00 GMT</pubDate><guid>http://blogs.clearscreen.com/ragc/archive/2004/10/28/525.aspx</guid><wfw:comment>http://blogs.clearscreen.com/ragc/comments/525.aspx</wfw:comment><comments>http://blogs.clearscreen.com/ragc/archive/2004/10/28/525.aspx#Feedback</comments><slash:comments>27</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/ragc/comments/commentRss/525.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/ragc/services/trackbacks/525.aspx</trackback:ping><description>&lt;P&gt;This is the error that I get if try to view an aspx page with any server control that uses the DataBinder.Eval function, like the following&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&amp;lt;asp:Button id=but Text="Button" runat="server"&amp;nbsp; &lt;STRONG&gt;CommandArgument="&amp;lt;%# DataBinder.Eval(Container.DataItem, ("ColIndex")) %&amp;gt;"&lt;/STRONG&gt;&amp;gt; &amp;lt;/asp:Button&amp;gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The problem is that the ASP.NET parser does not allows nested double quotes. The solution is very easy, use single quotes for the HTML property instead of double quotes:&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&amp;lt;asp:Button id=but Text="Button" runat="server"&amp;nbsp; CommandArgument=&lt;STRONG&gt;&lt;FONT color=#ff0000&gt;'&lt;/FONT&gt;&lt;/STRONG&gt;&amp;lt;%# DataBinder.Eval(Container.DataItem, ("ColIndex")) %&amp;gt;&lt;STRONG&gt;&lt;FONT color=#ff0000&gt;'&lt;/FONT&gt;&lt;/STRONG&gt;&amp;gt;&amp;lt;/asp:Button&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The most probably is&amp;nbsp;the problem raises before you are trying to view the page in the browser, when you want to switch between the HTML view and the Design view in the Visual Studio editor, the development environment show a message with the following text:&lt;/P&gt;
&lt;P&gt;---------------------------&lt;BR&gt;Microsoft Development Environment&lt;BR&gt;---------------------------&lt;BR&gt;Could not open in Design view. Quote values differently inside a '&lt;% ..."value"... %&gt;' block.&lt;BR&gt;---------------------------&lt;BR&gt;&lt;BR&gt;I think that the message doesn't help you too much to identify the problem...&lt;/P&gt;&lt;img src ="http://blogs.clearscreen.com/ragc/aggbug/525.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Raúl Alarcón García-Cuevas</dc:creator><title>Hiding secrets in ASP.NET</title><link>http://blogs.clearscreen.com/ragc/archive/2004/05/18/256.aspx</link><pubDate>Tue, 18 May 2004 15:01:00 GMT</pubDate><guid>http://blogs.clearscreen.com/ragc/archive/2004/05/18/256.aspx</guid><wfw:comment>http://blogs.clearscreen.com/ragc/comments/256.aspx</wfw:comment><comments>http://blogs.clearscreen.com/ragc/archive/2004/05/18/256.aspx#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/ragc/comments/commentRss/256.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/ragc/services/trackbacks/256.aspx</trackback:ping><description>&lt;P&gt;Sometimes, we need store sensible information, such connections strings or the identity to impersonate&amp;nbsp;our ASP.NET application, in the web.config file. Well, it could be a best practice encrypt this information to keep aware from possible security risks. In this way, you may think that there are no problem if you store sensible information in the web.config file because of the IIS never serves this kind of pages... well, remember what happened with the "Global.asa" file and IIS 4.0, because of&amp;nbsp; security hole an experimented user was able to get the Globa.asp file and, by the way, all the information stored inside (normally connection strings with user and password information, file locations...). &lt;/P&gt;
&lt;P&gt;To make easy the hard task of encrypting info, here is a "How to:" article that show us how to protect the sensible information stored in the web.config file in a simple way: &lt;A href="http://support.microsoft.com/default.aspx?scid=kb;en-us;329290" target=_blank&gt;http://support.microsoft.com/default.aspx?scid=kb;en-us;329290&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The best:&lt;/STRONG&gt; the capability of encrypt the identify information in the web.config. Think that this information is managed only by the framework, the developers can't interact with (to decrypt) when the framework reads this information.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The worst:&lt;/STRONG&gt; this encryption mechanism relies on &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsecure/html/windataprotection-dpapi.asp" target=_blank&gt;DPAPI&lt;/A&gt;, this means that the keys used to encrypt / decrypt data are stored in a safe place and are based in the Hardward configuration of the local machine... the information encrypted in, by example, develop machine, can't be decrypted in the production machine. This could be an problem at the deployment time, specially if in our production environment we have a farm of front-end servers, we must configure the web.config file for each server at the deployment time.&lt;/P&gt;&lt;img src ="http://blogs.clearscreen.com/ragc/aggbug/256.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>