<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Code Junkie</title><subtitle type="html" /><id>http://blogs.msdn.com/codejunkie/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/codejunkie/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2009-06-23T01:40:09Z</updated><entry><title>Anti-XSS vNext – Web Protection Library</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/11/05/anti-xss-vnext-web-protection-library.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/11/05/anti-xss-vnext-web-protection-library.aspx</id><published>2009-11-05T19:17:20Z</published><updated>2009-11-05T19:17:20Z</updated><content type="html">&lt;p&gt;Want to know more when you can get your hands on the next version of Anti-XSS library, check out this blog about our upcoming CTP release of Web Protection Library.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/securitytools/archive/2009/10/17/web-protection-library-ctp-release-coming-soon.aspx" href="http://blogs.msdn.com/securitytools/archive/2009/10/17/web-protection-library-ctp-release-coming-soon.aspx"&gt;http://blogs.msdn.com/securitytools/archive/2009/10/17/web-protection-library-ctp-release-coming-soon.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Thanks&lt;/p&gt;  &lt;p&gt;Anil&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9918168" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author></entry><entry><title>How to Detect and avoid memory Leaks in .NET applications?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/11/05/how-to-detect-and-avoid-memory-leaks-in-net-applications.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/11/05/how-to-detect-and-avoid-memory-leaks-in-net-applications.aspx</id><published>2009-11-05T19:13:56Z</published><updated>2009-11-05T19:13:56Z</updated><content type="html">&lt;p&gt;Here is an excellent MSDN article on how to detect and avoid memory leaks in .NET applications.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://msdn.microsoft.com/en-us/library/ee658248.aspx" href="http://msdn.microsoft.com/en-us/library/ee658248.aspx"&gt;http://msdn.microsoft.com/en-us/library/ee658248.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;A must read for Sr. Developers and Testers.&lt;/p&gt;  &lt;p&gt;Thanks   &lt;br /&gt;Anil&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9918164" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author></entry><entry><title>Anti-XSS Library v3.1 is now Live!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/09/23/anti-xss-library-v3-1-is-now-live.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/09/23/anti-xss-library-v3-1-is-now-live.aspx</id><published>2009-09-23T22:08:35Z</published><updated>2009-09-23T22:08:35Z</updated><content type="html">&lt;p&gt;You can now download the new version of Anti-XSS library v3.1 from &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=051EE83C-5CCF-48ED-8463-02F56A6BFC09&amp;amp;displaylang=en"&gt;Microsoft.com Download Center.&lt;/a&gt; For more details check this blog post.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/securitytools/archive/2009/09/17/anti-xss-library-v3-1-released.aspx" href="http://blogs.msdn.com/securitytools/archive/2009/09/17/anti-xss-library-v3-1-released.aspx"&gt;http://blogs.msdn.com/securitytools/archive/2009/09/17/anti-xss-library-v3-1-released.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Thanks   &lt;br /&gt;Anil&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9898601" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author></entry><entry><title>HTML Sanitization using Anti-XSS Library</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/09/23/html-sanitization-using-anti-xss-library.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/09/23/html-sanitization-using-anti-xss-library.aspx</id><published>2009-09-23T20:14:31Z</published><updated>2009-09-23T20:14:31Z</updated><content type="html">&lt;p&gt;Now you can filter (sanitize) HTML using Anti-XSS library v3.1 features. More information can be found at &lt;a title="http://blogs.msdn.com/securitytools/archive/2009/09/01/html-sanitization-in-anti-xss-library.aspx" href="http://blogs.msdn.com/securitytools/archive/2009/09/01/html-sanitization-in-anti-xss-library.aspx"&gt;http://blogs.msdn.com/securitytools/archive/2009/09/01/html-sanitization-in-anti-xss-library.aspx&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Thanks   &lt;br /&gt;RV&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9898543" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author></entry><entry><title>Cascading Style Sheet Strings Encoding</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/08/26/cascading-style-sheet-strings-encoding.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/08/26/cascading-style-sheet-strings-encoding.aspx</id><published>2009-08-26T18:53:43Z</published><updated>2009-08-26T18:53:43Z</updated><content type="html">&lt;p&gt;I recently blogged about encoding cascading style sheet strings. A new feature is being added to the next version of Web Protection Library (anti-xss library).&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/securitytools/archive/2009/08/21/encoding-cascading-style-sheet-strings.aspx" href="http://blogs.msdn.com/securitytools/archive/2009/08/21/encoding-cascading-style-sheet-strings.aspx"&gt;http://blogs.msdn.com/securitytools/archive/2009/08/21/encoding-cascading-style-sheet-strings.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Thanks   &lt;br /&gt;Anil RV&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9885499" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author></entry><entry><title>LDAP Injection and Mitigation</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/08/11/ldap-injection-and-mitigation.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/08/11/ldap-injection-and-mitigation.aspx</id><published>2009-08-11T20:37:15Z</published><updated>2009-08-11T20:37:15Z</updated><content type="html">&lt;p&gt;Yesterday I posted a blog entry on our team blog about LDAP Injection and how to mitigate it using the next version of WPL. You can find it here.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/securitytools/archive/2009/08/11/ldap-injection-and-mitigation.aspx" href="http://blogs.msdn.com/securitytools/archive/2009/08/11/ldap-injection-and-mitigation.aspx"&gt;http://blogs.msdn.com/securitytools/archive/2009/08/11/ldap-injection-and-mitigation.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Thanks   &lt;br /&gt;RV&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9864674" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author></entry><entry><title>Understanding SDL-LOB Blog Series</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/07/30/understanding-sdl-lob-blog-series.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/07/30/understanding-sdl-lob-blog-series.aspx</id><published>2009-07-30T22:36:20Z</published><updated>2009-07-30T22:36:20Z</updated><content type="html">&lt;p&gt;My colleague Anmol has done it again, he has posted more blog entries on specific phases of Security Development Lifecycle for Line-of-Business (SDL-LOB)applications. These posts give you more details on what are the action items in specific phase and associated tools, checklists etc.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/ace_team/archive/2009/06/16/blog-series-get-familiar-with-the-sdl-lob-process-introduction-to-phase-1-requirements-for-lob.aspx"&gt;Blog Series- Get Familiar with the SDL-LOB Process, Introduction to Phase 1- Requirements for LOB&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="Blog Series- Get Familiar with the SDL-LOB Process, Introduction to Phase 2- Design for LOB" href="http://blogs.msdn.com/ace_team/archive/2009/06/19/blog-series-get-familiar-with-the-sdl-lob-process-introduction-to-phase-2-design-for-lob.aspx"&gt;Blog Series- Get Familiar with the SDL-LOB Process, Introduction to Phase 2- Design for LOB&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/ace_team/archive/2009/07/13/blog-series-get-familiar-with-the-sdl-lob-process-introduction-to-phase-3-implementation-for-lob.aspx"&gt;Blog Series- Get Familiar with the SDL-LOB Process. Introduction to Phase 3- Implementation for LOB&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/ace_team/archive/2009/07/29/blog-series-get-familiar-with-the-sdl-lob-process-introduction-to-phase-4-verification-for-lob.aspx"&gt;Blog Series- Get Familiar with the SDL-LOB Process. Introduction to Phase 4- Verification for LOB&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;A must read for security professionals!&lt;/p&gt;  &lt;p&gt;Thanks   &lt;br /&gt;RV&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9853683" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author></entry><entry><title>Security Guidance and Threat Modeling</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/07/30/security-guidance-and-threat-modeling.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/07/30/security-guidance-and-threat-modeling.aspx</id><published>2009-07-30T22:27:35Z</published><updated>2009-07-30T22:27:35Z</updated><content type="html">&lt;p&gt;I just posted a blog entry on the main drivers behind CTL in TAM v3.0. You can check it out at IST blog site.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/securitytools/archive/2009/07/30/security-guidance-and-threat-modeling.aspx" href="http://blogs.msdn.com/securitytools/archive/2009/07/30/security-guidance-and-threat-modeling.aspx"&gt;http://blogs.msdn.com/securitytools/archive/2009/07/30/security-guidance-and-threat-modeling.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Thanks    &lt;br /&gt;RV&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9853674" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author></entry><entry><title>OWASP Seattle Chapter Talk on Anti-XSS</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/07/29/owasp-seattle-chapter-talk-on-anti-xss.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/07/29/owasp-seattle-chapter-talk-on-anti-xss.aspx</id><published>2009-07-29T05:54:19Z</published><updated>2009-07-29T05:54:19Z</updated><content type="html">&lt;p&gt;Two weeks from now on August 11th in Bellevue I am going to talk about Anti-XSS Library. Talk is not only about the new features but also about the internal workings on Anti-XSS and some tidbits on our new WPL internals. Its going to be in the evening at 6:30 pm in Bellevue Las Margaritas.&lt;/p&gt;  &lt;p&gt;Bellevue Las Margaritas    &lt;br /&gt;437 108th Ave NE     &lt;br /&gt;Bellevue, WA 98004     &lt;br /&gt;(425) 453-0535 &lt;/p&gt;  &lt;p&gt;For more details on other speakers and abstract, please check.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.owasp.org/index.php/Seattle#Next_Event_11_August_.28Tuesday.29" href="http://www.owasp.org/index.php/Seattle#Next_Event_11_August_.28Tuesday.29"&gt;http://www.owasp.org/index.php/Seattle#Next_Event_11_August_.28Tuesday.29&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Thanks   &lt;br /&gt;RV&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9851648" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author></entry><entry><title>TAM v3.0 beta is live!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/07/21/tam-v3-0-beta-is-live.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/07/21/tam-v3-0-beta-is-live.aspx</id><published>2009-07-21T21:33:11Z</published><updated>2009-07-21T21:33:11Z</updated><content type="html">&lt;p&gt;A new version of threat analysis and modeling tool has been released. This version has significant improvements from previous version as identified in previous posts. You can find more information on the download link and bugs link from &lt;a title="TAM 3.0 Beta is Now Live!" href="http://blogs.msdn.com/securitytools/archive/2009/07/21/tam-3-0-beta-is-now-live.aspx"&gt;TAM 3.0 Beta is Now Live!&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Thanks   &lt;br /&gt;RV&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9843639" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author><category term=".NET" scheme="http://blogs.msdn.com/codejunkie/archive/tags/.NET/default.aspx" /><category term="Security" scheme="http://blogs.msdn.com/codejunkie/archive/tags/Security/default.aspx" /></entry><entry><title>TAM v3.0 New Features!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/07/20/tam-v3-0-new-features.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/07/20/tam-v3-0-new-features.aspx</id><published>2009-07-21T01:01:03Z</published><updated>2009-07-21T01:01:03Z</updated><content type="html">&lt;p&gt;Just posted a blog entry on the new threat analysis and modeling release features on our security tools blog site. Check it out at &lt;a title="Threat Analysis And Modeling (TAM) v3.0 – Learn about the New Features!" href="http://blogs.msdn.com/securitytools/archive/2009/07/20/threat-analysis-and-modeling-tam-v3-0-learn-about-the-new-features.aspx"&gt;Threat Analysis And Modeling (TAM) v3.0 – Learn about the New Features!&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Thanks   &lt;br /&gt;RV&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9842368" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author></entry><entry><title>Connection String Injection Attack</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/07/20/connection-string-injection-attack.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/07/20/connection-string-injection-attack.aspx</id><published>2009-07-21T00:58:11Z</published><updated>2009-07-21T00:58:11Z</updated><content type="html">&lt;p&gt;Today I was looking at some new classes in .NET 2.0 and stumbled across DbConnectionStringBuilder class. This class provides compile time checks around building connection strings with user input. If you are constructing connection string dynamically by accepting server name from the&amp;#160; user you could be vulnerable to this attack. Here is an example on how to mitigate that using SqlConnectionStringBuilder class.&lt;/p&gt;  &lt;pre class="csharpcode"&gt;System.Data.SqlClient.SqlConnectionStringBuilder builder =
  &lt;span class="kwrd"&gt;new&lt;/span&gt; System.Data.SqlClient.SqlConnectionStringBuilder();
builder[&lt;span class="str"&gt;&amp;quot;Data Source&amp;quot;&lt;/span&gt;] = &lt;span class="str"&gt;&amp;quot;(local)&amp;quot;&lt;/span&gt;;
builder[&lt;span class="str"&gt;&amp;quot;Integrated Security&amp;quot;&lt;/span&gt;] = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
builder[&lt;span class="str"&gt;&amp;quot;Initial Catalog&amp;quot;&lt;/span&gt;] = &lt;span class="str"&gt;&amp;quot;AdventureWorks&amp;quot;&lt;/span&gt;;
builder[&lt;span class="str"&gt;&amp;quot;Persist Security Info&amp;quot;&lt;/span&gt;] = &lt;span class="str"&gt;&amp;quot;false&amp;quot;&lt;/span&gt;;
Console.WriteLine(builder.ConnectionString);&lt;/pre&gt;

&lt;p&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;If you re using user input to create a connection string, you must use this class. Additionally you should perform input validation before passing data to this class. For more information about this class and generic connection string security check the following links.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms254947.aspx"&gt;Connection String Builders (ADO.NET)&lt;/a&gt;

  &lt;br /&gt;&lt;a href="http://msmvps.com/blogs/williamryan/archive/2006/01/15/81115.aspx"&gt;Using the SqlConnectionStringBuilder to guard against Connection String Injection Attacks&lt;/a&gt;

  &lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/89211k9b(VS.80).aspx"&gt;Securing Connection Strings&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks
  &lt;br /&gt;Anil&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9842364" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author><category term=".NET" scheme="http://blogs.msdn.com/codejunkie/archive/tags/.NET/default.aspx" /><category term="Security" scheme="http://blogs.msdn.com/codejunkie/archive/tags/Security/default.aspx" /></entry><entry><title>Web Protection Library – new Project</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/07/09/web-protection-library-new-project.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/07/09/web-protection-library-new-project.aspx</id><published>2009-07-09T22:25:07Z</published><updated>2009-07-09T22:25:07Z</updated><content type="html">&lt;p&gt;Another post on the new security tools blog about WPL.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/securitytools/archive/2009/07/09/web-protection-library-wpl-a-brief-introduction.aspx" href="http://blogs.msdn.com/securitytools/archive/2009/07/09/web-protection-library-wpl-a-brief-introduction.aspx"&gt;http://blogs.msdn.com/securitytools/archive/2009/07/09/web-protection-library-wpl-a-brief-introduction.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Thanks   &lt;br /&gt;RV&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9827477" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/codejunkie/archive/tags/Security/default.aspx" /></entry><entry><title>Threat Analysis and Modeling 3.0 Video</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/07/07/threat-analysis-and-modeling-3-0-video.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/07/07/threat-analysis-and-modeling-3-0-video.aspx</id><published>2009-07-07T22:14:29Z</published><updated>2009-07-07T22:14:29Z</updated><content type="html">&lt;p&gt;Here is a &lt;a href="http://channel9.msdn.com/posts/Jossie/Thread-Analysis--Modeling-Tool-TAM-30/"&gt;video&lt;/a&gt; that I did couple of weeks back about TAM 3.0 release. It gives some details on the new features and how we started working on TAM 3.0 release. Will post more details as I get them.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://channel9.msdn.com/posts/Jossie/Thread-Analysis--Modeling-Tool-TAM-30/" href="http://channel9.msdn.com/posts/Jossie/Thread-Analysis--Modeling-Tool-TAM-30/"&gt;http://channel9.msdn.com/posts/Jossie/Thread-Analysis--Modeling-Tool-TAM-30/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Thanks   &lt;br /&gt;Anil RV&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9823060" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/codejunkie/archive/tags/Security/default.aspx" /><category term="Talks" scheme="http://blogs.msdn.com/codejunkie/archive/tags/Talks/default.aspx" /></entry><entry><title>Multiple Modal POPUPS and Z-Index</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/codejunkie/archive/2009/06/23/multiple-modal-popups-and-z-index.aspx" /><id>http://blogs.msdn.com/codejunkie/archive/2009/06/23/multiple-modal-popups-and-z-index.aspx</id><published>2009-06-23T03:40:09Z</published><updated>2009-06-23T03:40:09Z</updated><content type="html">&lt;p&gt;AJAX modal popup extender gives developers ability to show javascript based modal windows. This powerful extender can be used to show editing UI, progress bars and/or error messages etc. This does pose some challenges specially when there are two modal popups that get invoked. During some of my tests, popups seemed to be displayed in an order where one popup is hidden beneath other popup. This is specially true when showing progress popups when an popup is already on the page.&lt;/p&gt;  &lt;p&gt;This problem can be easily solved by using larger z-index values for popup css classes. Ensure that progress window is always higher than the rest of z-index. Here is a sample css classes for progress and regular popups.&lt;/p&gt;  &lt;pre class="csharpcode"&gt;.modalBackground 
{    
    position:absolute;
    z-index:10000;
}

.modalWindow
{
    position:absolute;
    z-index:10001;
}

&lt;span class="rem"&gt;/* Separate css element for error modals to specify &lt;/span&gt;
&lt;span class="rem"&gt;z-index to get the popup on top of all existing popups*/&lt;/span&gt;
.progressModalWindow
{
    z-index:11000;
    position:absolute;
}

.progressModalBackground 
{
    z-index:10999;
    position:absolute;
}&lt;/pre&gt;

&lt;p&gt;&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;Additionally I changed the AjaxControlToolkit/ModalPopup/ModalPopupBehavior.js to ensure that these custom values are used for styling. Because toolkit default code contains hardcoded z-index values. Comment the lines &lt;strong&gt;118 and 126&lt;/strong&gt;.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;this&lt;/span&gt;._backgroundElement.style.zIndex = 10000; &lt;span class="rem"&gt;//Comment this line. 118&lt;/span&gt;
....
....
....
&lt;span class="rem"&gt;//Comment this line. 126&lt;/span&gt;
&lt;span class="kwrd"&gt;this&lt;/span&gt;._foregroundElement.style.zIndex = 
$common.getCurrentStyle(&lt;span class="kwrd"&gt;this&lt;/span&gt;._backgroundElement, &lt;span class="str"&gt;'zIndex'&lt;/span&gt;, &lt;br /&gt;&lt;span class="kwrd"&gt;this&lt;/span&gt;._backgroundElement.style.zIndex) + 1; &lt;/pre&gt;

&lt;p&gt;Once you comment the two lines, your css elements should take over and should provide the necessary z-index order to the popup div’s.&lt;/p&gt;

&lt;p&gt;Thanks
  &lt;br /&gt;Anil&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9798563" width="1" height="1"&gt;</content><author><name>anilkr</name><uri>http://blogs.msdn.com/members/anilkr.aspx</uri></author></entry></feed>