<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1844338521119952928</id><updated>2012-02-17T00:05:10.861+01:00</updated><category term='Google Maps'/><category term='Twitter'/><category term='Team Foundation Server'/><category term='Notification'/><category term='CSS'/><category term='Encriptar'/><category term='Javascript'/><category term='Feeds'/><category term='Source Control'/><category term='Asp.Net'/><category term='TFS'/><category term='Sql Server'/><category term='Silverlight 4'/><category term='Gmail'/><category term='.Net 4'/><category term='Search'/><category term='Sql Injection'/><category term='Visual Studio 2010'/><category term='Google Search'/><category term='Transactions'/><category term='Xml'/><category term='WCF'/><category term='Overlay'/><category term='Bing Maps'/><category term='Net Framework 4'/><category term='HTML'/><category term='Code-Behind'/><category term='PopUp'/><category term='Search Web'/><category term='Asp.Net 4'/><category term='Error'/><category term='IIS7'/><category term='Deploy'/><category term='ModalPopUp'/><category term='Windows 7'/><category term='Sql Parameters'/><title type='text'>I Love Coding</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-1455188464665889945</id><published>2012-01-05T14:31:00.004+01:00</published><updated>2012-01-05T15:09:03.328+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Overlay'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Notification'/><title type='text'>Silverlight Overlay Notification</title><content type='html'>&lt;br /&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;Welcomeback to my blog!&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;This isthe first post of 2012, so just before getting started, I'd like to wish you ahappy new year.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;Thistime I want to share something very simple for Silverlight. I do not likeapplications that continuosly bother me with popup messages to make me awarethat something happened. I do not like a message box coming up saying"Changes were saved succesfully" right after pressing the savebutton. I want to keep working or doing some other stuff without beinginterrupted. I would like to be told that it worked if it allows me to keepgoing, and of course, I want to know if something went wrong. &lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;Youknow during Christmas a lot of messages full of best wishes are going around .I sent one of those to one friend and after a while an Overlay Notification appearedat the bottom of my Galaxy's screen saying "Message received by [contact]". Then I realized that this is the kind of notification that I, asan user, like. Therefore, is the kind of notification, that I, as a developer,would like to use henceforth (unless until I find something better :-D ).&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;b&gt;TheCode&lt;/b&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;Let uscreate a User Control. Our control will be the already mentioned OverlayNotification. We'll make it appear and disappear after a while without userinteraction. This could be the XAML code:&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;lt;&lt;span style="color: #990000;"&gt;UserControl &lt;/span&gt;&lt;span style="color: red;"&gt;x:Class&lt;/span&gt;&lt;span style="color: blue;"&gt;="SilverlightTestApp.Controls.OverlayNotification"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;xmlns:x&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;xmlns:d&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/expression/blend/2008"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;xmlns:mc&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.openxmlformats.org/markup-compatibility/2006"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;mc:Ignorable&lt;/span&gt;&lt;span style="color: blue;"&gt;="d"&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;span style="color: #990000;"&gt;UserControl.Resources&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;span style="color: #990000;"&gt;Storyboard &lt;/span&gt;&lt;span style="color: red;"&gt;x:Name&lt;/span&gt;=&lt;span style="color: blue;"&gt;"ShowMessage" &lt;/span&gt;&lt;span style="color: red;"&gt;Completed&lt;/span&gt;=&lt;span style="color: blue;"&gt;"ShowMessage_Completed"&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;span style="color: #990000;"&gt;DoubleAnimation&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;Duration&lt;/span&gt;&lt;span style="color: blue;"&gt;="00:00:06"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;From&lt;/span&gt;&lt;span style="color: blue;"&gt;="0.00"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;To&lt;/span&gt;&lt;span style="color: blue;"&gt;="1.00"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;AutoReverse&lt;/span&gt;&lt;span style="color: blue;"&gt;="True"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;Storyboard.TargetName&lt;/span&gt;&lt;span style="color: blue;"&gt;="Popup"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;Storyboard.TargetProperty&lt;/span&gt;&lt;span style="color: blue;"&gt;="Opacity"&lt;/span&gt;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/&lt;span style="color: #990000;"&gt;Storyboard&lt;/span&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/&lt;span style="color: #990000;"&gt;UserControl.Resources&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;span style="color: #990000;"&gt;Grid &lt;/span&gt;&lt;span style="color: red;"&gt;x:Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="LayoutRoot"&lt;/span&gt; &lt;span style="color: red;"&gt;Background&lt;/span&gt;=&lt;span style="color: blue;"&gt;"White"&lt;/span&gt; &lt;span style="color: red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;="Center"&lt;/span&gt; &amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;span style="color: #990000;"&gt;Border &lt;/span&gt;&lt;span style="color: red;"&gt;BorderBrush&lt;/span&gt;=&lt;span style="color: blue;"&gt;"Black"&lt;/span&gt; &lt;span style="color: red;"&gt;BorderThickness&lt;/span&gt;&lt;span style="color: blue;"&gt;="1"&lt;/span&gt; &lt;span style="color: red;"&gt;MinWidth&lt;/span&gt;&lt;span style="color: blue;"&gt;="150"&lt;/span&gt; &lt;span style="color: red;"&gt;MaxWidth&lt;/span&gt;=&lt;span style="color: blue;"&gt;"550"&lt;/span&gt; &lt;span style="color: red;"&gt;MaxHeight&lt;/span&gt;=&lt;span style="color: blue;"&gt;"75"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style="color: red;"&gt;CornerRadius&lt;/span&gt;&lt;span style="color: blue;"&gt;="4"&lt;/span&gt; &lt;span style="color: red;"&gt;Background&lt;/span&gt;&lt;span style="color: blue;"&gt;="Transparent"&lt;/span&gt; &lt;span style="color: red;"&gt;Visibility&lt;/span&gt;=&lt;span style="color: blue;"&gt;"Collapsed" &lt;/span&gt;&lt;span style="color: red;"&gt;Opacity&lt;/span&gt;&lt;span style="color: blue;"&gt;="0"&lt;/span&gt; &lt;span style="color: red;"&gt;x:Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="Popup"&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;span style="color: #990000;"&gt;TextBlock &lt;/span&gt;&lt;span style="color: red;"&gt;x:Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="lblMessage"&lt;/span&gt; &lt;span style="color: red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;="Center"&lt;/span&gt; &lt;span style="color: red;"&gt;TextWrapping&lt;/span&gt;&lt;span style="color: blue;"&gt;="Wrap"&lt;/span&gt; &lt;span style="color: red;"&gt;MaxWidth&lt;/span&gt;&lt;span style="color: blue;"&gt;="400"&lt;/span&gt; &lt;span style="color: red;"&gt;MaxHeight&lt;/span&gt;=&lt;span style="color: blue;"&gt;"75"&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span style="color: #990000;"&gt;TextBlock&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/&lt;span style="color: #990000;"&gt;Border&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/&lt;span style="color: #990000;"&gt;Grid&lt;/span&gt;&amp;gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;lt;/&lt;span style="color: #990000;"&gt;UserControl&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;We havea &lt;span style="color: #990000;"&gt;&lt;i&gt;Storyboard &lt;/i&gt;&lt;/span&gt;that will be triggered whenever we want to show the Notification.It will last 6 seconds (plus another 6 because of the &lt;span style="color: red;"&gt;&lt;i&gt;AutoReverse&lt;/i&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;i&gt;=true&lt;/i&gt;&lt;/span&gt;). Andwill change the &lt;span style="color: red;"&gt;&lt;i&gt;Opacity &lt;/i&gt;&lt;/span&gt;of our notification area to give the impression that itfades in and out.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;Then wehave a &lt;span style="color: #990000;"&gt;&lt;i&gt;Border &lt;/i&gt;&lt;/span&gt;with rounded corners. We'll have to make it visible whenever wewant to show the message and hide it when the &lt;span style="color: #990000;"&gt;&lt;i&gt;Storyboard &lt;/i&gt;&lt;/span&gt;is done. Inside ofthis &lt;i&gt;&lt;span style="color: #990000;"&gt;Border &lt;/span&gt;&lt;/i&gt;we will have a &lt;i&gt;&lt;span style="color: #990000;"&gt;Textblock &lt;/span&gt;&lt;/i&gt;where our message will be displayed.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;Let'stake a look at the code behind:&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&lt;span style="color: blue;"&gt;using &lt;/span&gt;System.Windows;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Windows.Controls;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&lt;span style="color: blue;"&gt;using &lt;/span&gt;System.Windows.Media;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&lt;span style="color: blue;"&gt;namespace &lt;/span&gt;SilverlightTestApp.Controls&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp;&lt;span style="color: blue;"&gt; public partial class&lt;/span&gt; &lt;span style="color: #6fa8dc;"&gt;OverlayNotification &lt;/span&gt;: &lt;span style="color: #6fa8dc;"&gt;UserControl&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;private string&lt;/span&gt; _message;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;public string&lt;/span&gt; Message&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;return &lt;/span&gt;_message;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;set&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _message = &lt;span style="color: blue;"&gt;value&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lblMessage.Text = &lt;span style="color: blue;"&gt;value&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Popup.Visibility = &lt;span style="color: #6fa8dc;"&gt;Visibility&lt;/span&gt;.Visible;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ShowMessage.Begin();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;private &lt;/span&gt;&lt;span style="color: #999999;"&gt;System.Windows.Media&lt;/span&gt;.&lt;span style="color: #6fa8dc;"&gt;Color &lt;/span&gt;_color;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;public &lt;/span&gt;&lt;span style="color: #999999;"&gt;System.Windows.Media&lt;/span&gt;.&lt;span style="color: #6fa8dc;"&gt;Color&lt;/span&gt; Color&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;return &lt;/span&gt;_color;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;set&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _color = &lt;span style="color: blue;"&gt;value&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;var &lt;/span&gt;newBrush = new&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: #6fa8dc;"&gt;SolidColorBrush&lt;/span&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; newBrush.Color = &lt;span style="color: blue;"&gt;value&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lblMessage.Foreground = newBrush;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;public &lt;/span&gt;OverlayNotification()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InitializeComponent();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void &lt;/span&gt;ShowMessage_Completed(&lt;span style="color: blue;"&gt;object &lt;/span&gt;sender, System.&lt;span style="color: #6fa8dc;"&gt;EventArgs &lt;/span&gt;e)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Popup.Visibility = &lt;span style="color: #6fa8dc;"&gt;Visibility&lt;/span&gt;.Collapsed;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;We willexpose at least the &lt;span style="color: red;"&gt;&lt;i&gt;Message &lt;/i&gt;&lt;/span&gt;property (we also have the &lt;span style="color: red;"&gt;&lt;i&gt;Color &lt;/i&gt;&lt;/span&gt;property for thefont). Notice that everytime we set the &lt;i&gt;&lt;span style="color: red;"&gt;Message &lt;/span&gt;&lt;/i&gt;property we update the&lt;span style="color: #990000;"&gt;&lt;i&gt;Textblock&lt;/i&gt;&lt;/span&gt;'s text, make the &lt;i&gt;&lt;span style="color: #990000;"&gt;Border &lt;/span&gt;&lt;/i&gt;visible and trigger the &lt;span style="color: #990000;"&gt;&lt;i&gt;Storyboard&lt;/i&gt;&lt;/span&gt;. Alsonoticed that we handle the &lt;span style="color: #990000;"&gt;&lt;i&gt;Storyboard&lt;/i&gt;&lt;/span&gt;'s completed event to hide the &lt;i&gt;&lt;span style="color: #990000;"&gt;Border&lt;/span&gt;&lt;/i&gt;.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;To useit, just add this new User Control into the view where you want to use it inthe same way that you would place a Textbox or any other control:&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&amp;lt;&lt;span style="color: #990000;"&gt;my&lt;/span&gt;:&lt;span style="color: #990000;"&gt;OverlayNotification&lt;/span&gt;&lt;span style="color: red;"&gt;x:Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="myOverlayNotification"&lt;/span&gt;/&amp;gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;Then,whenever you want to show a Notification, just set the &lt;span style="color: red;"&gt;&lt;i&gt;Message &lt;/i&gt;&lt;/span&gt;property withthe message you want to display:&lt;/div&gt;&lt;div lang="es-TRAD" style="font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&amp;nbsp;myOverlayNotification.Color = &lt;span style="color: #6fa8dc;"&gt;Colors&lt;/span&gt;.Red;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&amp;nbsp;myOverlayNotification.Message = &lt;span style="color: #990000;"&gt;"This isa test notification"&lt;/span&gt;;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;b&gt;FinalComments&lt;/b&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;Feelfree to play around with it modifying the layout and appeareance of the controlin the XAML or adding more properties to be able to customize it more, forexample, adding a BackgroundColor property. Please share your changes in thecomments so everybody can learn or use your improvements.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;This isjust a simple example, but you could also adapt it to use it with the MVVMpattern.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;Asalways, thank you very much for reading. Leave any comment, concern, questionor suggestion that you may have.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;Hope ithelps!&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-1455188464665889945?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/1455188464665889945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2012/01/silverlight-overlay-notification.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/1455188464665889945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/1455188464665889945'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2012/01/silverlight-overlay-notification.html' title='Silverlight Overlay Notification'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-3430913529976590271</id><published>2011-11-30T12:54:00.001+01:00</published><updated>2011-11-30T13:58:39.868+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='TFS'/><title type='text'>Missed Reconcile after Gated Check-in</title><content type='html'>&lt;br /&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 12.0pt; margin: 0in;"&gt;If youwork with Visual Studio Team Foundation Server and are using Gated Check-ins,after the build is done in the server you receive a nice Message Box with anice Reconcile button.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 12.0pt; margin: 0in;"&gt;&lt;br /&gt;Sometimesit happens that you close or miss that message… and then what? Your files arestill checked out, the projects you added are with the yellow cross besidesthem in the Solution Explorer, etc.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 12.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 12.0pt; margin: 0in;"&gt;Ok,never mind. Just go to the Team Explorer, open the Builds node and double clickthe corresponding build definition (if you know it) or just All Build Definitions. Use the filter that appears in the top of the opened tab to find the builds you recently triggered.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 12.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 12.0pt; margin: 0in;"&gt;Onceyou find the one you're looking for, right click it and click on Reconcile Workspace in the Context Menu.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-0lh2C8suwJY/TtYaGwWj76I/AAAAAAAAAJU/IyUa4Xhso5A/s1600/Reconcile+Workspace.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="117" src="http://3.bp.blogspot.com/-0lh2C8suwJY/TtYaGwWj76I/AAAAAAAAAJU/IyUa4Xhso5A/s320/Reconcile+Workspace.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Now you are ableto follow the same steps as if you wouldn't have missed the Message Box afterthe Gated Check-in with the Reconcile button.&lt;br /&gt;&lt;br /&gt;As always, feel free to leave any comment, suggestion or question that you may have.&lt;br /&gt;&lt;br /&gt;Hope that helps!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-3430913529976590271?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/3430913529976590271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2011/11/missed-reconcile-after-gated-check-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/3430913529976590271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/3430913529976590271'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2011/11/missed-reconcile-after-gated-check-in.html' title='Missed Reconcile after Gated Check-in'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-0lh2C8suwJY/TtYaGwWj76I/AAAAAAAAAJU/IyUa4Xhso5A/s72-c/Reconcile+Workspace.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-6912968617044350252</id><published>2011-11-21T14:04:00.001+01:00</published><updated>2011-11-23T14:08:49.064+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='TFS'/><category scheme='http://www.blogger.com/atom/ns#' term='Source Control'/><title type='text'>There appears to be a discrepancy between the solution's source control information about some project(s) and the information in the project file(s)</title><content type='html'>&lt;br /&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 14.0pt; margin: 0in;"&gt;&lt;span style="font-weight: bold;"&gt;TFS Source Control discrepancy&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;Recentlywe had a problem at work with the TFS. It was down for almost 3 hours. The TFSteam sent us and email saying that we should connect to a new server fromVisual Studio. So we did.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;Afterconnecting to the new one I saw some project files in my pending changes that Idid not checked-out. I tried to make an Undo and receive the following error:&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/--nSFfNZlIxQ/TsqPFud81-I/AAAAAAAAAJM/jXhE0Q1Zpzg/s1600/TFS+Source+Control+discrepancy.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="91" src="http://4.bp.blogspot.com/--nSFfNZlIxQ/TsqPFud81-I/AAAAAAAAAJM/jXhE0Q1Zpzg/s320/TFS+Source+Control+discrepancy.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;i&gt;"Thereappears to be a discrepancy between the solution's source control informationabout some project(s) and the information in the project file(s)"&lt;/i&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in;"&gt;&lt;span lang="es-TRAD" style="font-family: Calibri; font-size: 11pt;"&gt;Open the project file (with notepad, or unloading the project andright clicking it and selecting Edit) and look for the node &lt;/span&gt;&lt;span lang="es" style="color: blue; font-family: consolas; font-size: 10pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span lang="es-TRAD" style="color: #a31515; font-family: consolas; font-size: 10pt;"&gt;SccAuxPath&lt;/span&gt;&lt;span lang="es-TRAD" style="color: blue; font-family: consolas; font-size: 10pt;"&gt;&amp;gt; &lt;/span&gt;&lt;span lang="es-TRAD" style="font-family: Calibri; font-size: 11pt;"&gt;and see the value ithas. Now, right click the project file again in the Solution Explorer&lt;/span&gt;&lt;span lang="es-TRAD" style="color: blue; font-family: consolas; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span lang="es-TRAD" style="font-family: Calibri; font-size: 11pt;"&gt;(if you unloaded it,reload it) and click on View History. Double click in the last one that was ok, so you will see the file's code and you can now look for the same node. You will see adifferent value in the Server's project file than the one you have in theLocal's project file.&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;Theonly thing you should do is align them. Use the same value for them. Probablyit is best to update the Server's file with the new value of the Server'saddress (your Local file version would probably have the new Server's address).&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;Anotheroption you have is to set in both "SAK" (without "") inevery Scc starting node (there should be 4). "SAK" is, shortlyexplained, a flag that tells Visual Studio that the project is under SourceControl and the real bindings are persisted in the mssccprj.scc files.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 14.0pt; margin: 0in;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;i&gt;"...csproj.vspscc could not be found in yourworkspace or you do not have permission to access it."&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;Togetherwith the other error I faced this one. In order to be able to solve this thefirst thing is to check if the user under whom you are running VS haspermissions enought. If the user does, then you have a problem with your Workspace. Theonly thing that worked in my case was re-creating it. Make sure you check-inall the changes you want to keep&amp;nbsp; beforedeleting your current Workspace. You can create the new one with the same nameand in the same location.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;Asalways, please feel free to leave any comment, suggestion or question you mayhave. Hope this helps!&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; font-size: 11.0pt; margin: 0in;"&gt;Thanksfor reading!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-6912968617044350252?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/6912968617044350252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2011/11/tfs-discrepancy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/6912968617044350252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/6912968617044350252'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2011/11/tfs-discrepancy.html' title='There appears to be a discrepancy between the solution&apos;s source control information about some project(s) and the information in the project file(s)'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/--nSFfNZlIxQ/TsqPFud81-I/AAAAAAAAAJM/jXhE0Q1Zpzg/s72-c/TFS+Source+Control+discrepancy.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-3365285766422793162</id><published>2011-11-16T10:48:00.001+01:00</published><updated>2011-11-16T11:15:41.620+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Xml'/><title type='text'>Open, Modify and Save an Xml</title><content type='html'>&lt;a href="http://www.codeproject.com/script/Articles/BlogFeedList.aspx?amid=6806978" rel="tag" style="display: none;"&gt;CodeProject&lt;/a&gt;Welcome back to my blog!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This time I will be sharing something simple, that sometimes is needed and usually everybody tends to take more steps than needed.&lt;br /&gt;&lt;br /&gt;We will be opening an Xml file, modifying it and saving the changes. Let's assume the following scenario to understand the example (I know is a dummy scenario that won't probably happen, but it is enough to get the point):&lt;br /&gt;&lt;br /&gt;We have an Xml file with Customers. Every child node will have a single customer with its information in its attributes. Let's imagine that the attributes we have are Id, Name and Email. We will update the email address for a given customer.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Code&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;private&amp;nbsp; void&lt;/span&gt; ChangeCustomerEmailAddress(&lt;span class="Apple-style-span" style="color: blue;"&gt;string&lt;/span&gt;filename, &lt;span class="Apple-style-span" style="color: blue;"&gt;int &lt;/span&gt;customerId, &lt;span class="Apple-style-span" style="color: blue;"&gt;string &lt;/span&gt;newEmailAddress){&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bool&lt;/span&gt;changeMade = &lt;span class="Apple-style-span" style="color: blue;"&gt;false&lt;/span&gt;; &lt;span class="Apple-style-span" style="color: #38761d;"&gt;//Flag to check if changes were made and we need to save them&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;var &lt;/span&gt;xmlFile = &lt;span class="Apple-style-span" style="color: blue;"&gt;new &lt;/span&gt;&lt;span class="Apple-style-span" style="color: #6fa8dc;"&gt;XmlDocument&lt;/span&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;try&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlFile.Load(filename);&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="Apple-style-span" style="color: #6fa8dc;"&gt;XmlNode &lt;/span&gt;rootXmlNode =xmlFile.DocumentElement;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;if &lt;/span&gt;(rootXmlNode != &lt;span class="Apple-style-span" style="color: blue;"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;foreach &lt;/span&gt;(&lt;span class="Apple-style-span" style="color: #6fa8dc;"&gt;XmlNode &lt;/span&gt;childNode&lt;span class="Apple-style-span" style="color: blue;"&gt;in &lt;/span&gt;rootXmlNode)&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;if&lt;/span&gt;(&lt;span class="Apple-style-span" style="color: blue;"&gt;string&lt;/span&gt;.Equals(childNode.Name, &lt;span class="Apple-style-span" style="color: #990000;"&gt;"Customer"&lt;/span&gt;))&amp;nbsp; &lt;span class="Apple-style-span" style="color: #38761d;"&gt;//Change Customer with your ChildNode Name&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;foreach&lt;/span&gt;(&lt;span class="Apple-style-span" style="color: #6fa8dc;"&gt;XmlAttribute &lt;/span&gt;attribute &lt;span class="Apple-style-span" style="color: blue;"&gt;in &lt;/span&gt;childNode.Attributes)&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 1.125in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;int &lt;/span&gt;currentCustomerId = 0;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 1.125in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;if&lt;/span&gt;(&lt;span class="Apple-style-span" style="color: blue;"&gt;string&lt;/span&gt;.Equals(attribute.Name, &lt;span class="Apple-style-span" style="color: #990000;"&gt;"Id"&lt;/span&gt;))&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;currentCustomerId = attribute.Value;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;if&lt;/span&gt;(&lt;span class="Apple-style-span" style="color: blue;"&gt;string&lt;/span&gt;.Equals(attribute.Name, &lt;span class="Apple-style-span" style="color: #990000;"&gt;"Email"&lt;/span&gt;)&amp;nbsp; &amp;amp;&amp;amp; currentCustomerId == customerId )&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;attribute.Value = newEmailAddress;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;changeMade = &lt;span class="Apple-style-span" style="color: blue;"&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue; font-size: x-small;"&gt;break&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;if &lt;/span&gt;(changeMade)&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlFile.Save(filename);&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;catch &lt;/span&gt;(&lt;span class="Apple-style-span" style="color: #6fa8dc;"&gt;XmlException &lt;/span&gt;ex)&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="Apple-style-span" style="color: #38761d;"&gt;// Your error handling logicgoes here.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;b&gt;Understanding the code&lt;/b&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;We have a method that receives the whole path to the Xml file we want to modify, the customer ID and the new email address.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;We create a new instance of the XmlDocument class and load the document into memory. We loop through the nodes and look into the attributes. When we find the Id attribute, we save its value into a variable (currentCustomerId), so when we reach the Email attribute, if the current customer is the one we want to modify, then we set the current attribute(Email)'s value with the new email address and we exit the loop.&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;b&gt;Final words&lt;/b&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;It is that simple to modify an Xml on the fly in just one step. I hope it helps. Please note this is only a sample code. Feel free to leave any comments, questions, suggestions or whatever your concern is.&amp;nbsp;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div lang="es-TRAD" style="font-family: Calibri; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;Once again, thanks for reading!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-3365285766422793162?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/3365285766422793162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2011/11/open-modify-and-save-xml.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/3365285766422793162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/3365285766422793162'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2011/11/open-modify-and-save-xml.html' title='Open, Modify and Save an Xml'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-5187400122373917606</id><published>2011-08-26T12:01:00.000+02:00</published><updated>2011-08-26T12:01:09.537+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>WCF The remote server returned an error 415</title><content type='html'>Welcome back everybody!&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This time I just want to share a small tip. Working with a Silverlight-enabled WCF Service I got the following error after making a few changes:&amp;nbsp;&lt;b&gt;The remote server returned an error 415 &lt;/b&gt;(obviously the error message was way much longer). The weird thing is that there were no errors when compiling.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I started googling to find out how to solve it, but no suggestion worked for me. So I went backwards upon what I've done.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The WCF service uses a custom type defined in a class. I just added a few new properties to the class and realized that one looked like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;Public Property &lt;/span&gt;propertyName &lt;span class="Apple-style-span" style="color: blue;"&gt;As &lt;/span&gt;&lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;Nullable&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I just forgot to specify the type. So if you get this error, go backwards to the last thing you've done and check that you did not misspell anything and that you specified all the types correctly. So, solution in my case:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;Public Property&lt;/span&gt; propertyName as &lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;Nullable &lt;/span&gt;(&lt;span class="Apple-style-span" style="color: blue;"&gt;Of Date&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hope it helps!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-5187400122373917606?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/5187400122373917606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2011/08/wcf-remote-server-returned-error-415.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/5187400122373917606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/5187400122373917606'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2011/08/wcf-remote-server-returned-error-415.html' title='WCF The remote server returned an error 415'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-3692650969259604809</id><published>2011-08-10T13:12:00.001+02:00</published><updated>2011-08-10T13:15:35.888+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sql Injection'/><title type='text'>Preventing Sql Injection</title><content type='html'>Welcome back to my Blog!&lt;br /&gt;&lt;br /&gt;Sorry I've been "out" for a while. I just moved to Barcelona to start a new project in a new company and moving kept me way busy!&lt;br /&gt;&lt;br /&gt;Someone just asked me through the Blog's chat about Sql Injection (I guess he/she was reading the &lt;a href="http://nereolopez.blogspot.com/2011/03/transactions-with-parameters-2-standard.html"&gt;Transaction with Parameters&lt;/a&gt; articles) but connection was lost or something. So I'm leaving here two links that may help to understand how it works. The first one is a videotutorial and the second one is from msdn documentation.&lt;br /&gt;&lt;br /&gt;Videotutorial:&lt;br /&gt;&lt;a href="http://www.asp.net/security/videos/sql-injection-defense"&gt;http://www.asp.net/security/videos/sql-injection-defense&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Documentation:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms161953.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms161953.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hope it helps!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-3692650969259604809?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/3692650969259604809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2011/08/preventing-sql-injection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/3692650969259604809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/3692650969259604809'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2011/08/preventing-sql-injection.html' title='Preventing Sql Injection'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-2038031958974605679</id><published>2011-06-13T22:25:00.003+02:00</published><updated>2011-11-16T10:35:19.396+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PopUp'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Overlay'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><category scheme='http://www.blogger.com/atom/ns#' term='ModalPopUp'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Modal PopUp Overlay</title><content type='html'>Welcome back to my blog!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;This time I will share how to cause the same effect as the ModalPopUpExtender from the AjaxControlToolkit in Asp.Net using CSS and Ajax. We'll be able to create Master/Details, LookUps, Error Messages, or whatever other use you want to give it! There're a lot of approaches out there, so, probably nothing new... Just my way :-)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Background&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Well, if there's a ModalPopUpExtender in the AjaxControlToolkit, why not to use it and do something different?&lt;br /&gt;My scenario was such a pain for that. Let me explain:&lt;br /&gt;&lt;br /&gt;I have Master Pages, Web Pages, Content Holders and User Controls. User Controls are loaded dynamically when used as "PopUps". I started to search how to convert them into "PopUp Windows" and found two different ways that thought would work.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The firts try&lt;/b&gt;: ModalPopUpExtender.So I prepare everything: CSS background class, PopUpPanel, OkControl, CancelControl, etc... It looked great... but... whenever I clicked or used any control that would cause a Postback, the PopUp hid. Well, there's a workaround for that using Javascript to prevent the control itself to cause a postback or also we could try to reset the "state" (hidden or shown) of the popup after the postback... Too much work for me. If you remember, I'm loading dynamically usercontrols into the PopUpPanel... So I decided to use the second option.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The second try:&lt;/b&gt;&amp;nbsp;Well, the second try was using simple HTMLand CSS. I found an example where with two Divs and CSS could be achieved. It look familiar for me because that's the way sometimes I show UpdateProgress as ModalPopUp overlaying the page... How coudn't I think of it before? Well, in this case, it needed a little more than that, a Javascript function that would show and hide the Divs when needed. So, I started to try to call the Javascript function from code in the common different ways but due to my scenario (UserControls inside Panels inside UpdatePanels inside ContentHolders in a WebPage inside a MasterPage) I faced an error from the server trying to parse the request. So, as I was not able to change that structure to avoid the error, I thought that as I'm using Ajax, it would probably work with some changes, and that's what I did.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Code and the Solution&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Let's add an Update Panel. at the end of our Html (of course inside the content tag). Now, in the UpdatePanel ContentTemplate we'll just add two panels, one for the Overlay, and one for the PopUp.&lt;br /&gt;&lt;br /&gt;The second panel (panelPopUpPanel in the example below) has a nested panel, wich I use to create the "Title" bar: In the sample below, it just contains the "Close" button.&lt;br /&gt;After this nested panel (still inside the PopUpPanel) add whatever you want to display there (in the sample below, it contains a User Control call ucPopUpUsersQuickSearch)&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/-eQVgyfUKI90/TfZr6lNI0eI/AAAAAAAAAG4/o3fswgf9U3k/s1600/Html.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="125" src="http://4.bp.blogspot.com/-eQVgyfUKI90/TfZr6lNI0eI/AAAAAAAAAG4/o3fswgf9U3k/s400/Html.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;Notice that both panels (Overlay and PopUp) have the Class attribute set. Here is the Css to give the OverlayPanel an overlay effect and to give the PopUpPanel the position and size and border and whatever you want to specify for it. Play with it to change the appearance in a way you like it.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ZfgfEIVK7Nc/TfZspsGs9zI/AAAAAAAAAG8/KSjA1HqI0lM/s1600/Css.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-ZfgfEIVK7Nc/TfZspsGs9zI/AAAAAAAAAG8/KSjA1HqI0lM/s1600/Css.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Notice the Overlay position. It is set to "fixed". Why? If you have a large page that needs scrolling, with "fixed" you will overlay all the page even if scrolling.&lt;br /&gt;&lt;br /&gt;So, how do we show the Pop Up? Have you notice that the panels have their Visible attribute to false? Just change that attribute to show them or hide them, like this:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-zzdTeNxP46I/TfZt3Pk7kcI/AAAAAAAAAHA/jSXZXNOm97s/s1600/OverlayPopUp+CodeBehind.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-zzdTeNxP46I/TfZt3Pk7kcI/AAAAAAAAAHA/jSXZXNOm97s/s1600/OverlayPopUp+CodeBehind.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;That was just a function that receives a boolean parameter (true or false) and sets the Visible attribute of the panels to the value of the parameter received.&lt;br /&gt;&lt;br /&gt;And that's it, easy huh? &amp;nbsp;Here is how it looks!!&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-c30wwbv9rmM/TfZwoL2d9yI/AAAAAAAAAHE/H_iTbYvSTcs/s1600/PopUpOverlay+Result.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="489" src="http://4.bp.blogspot.com/-c30wwbv9rmM/TfZwoL2d9yI/AAAAAAAAAHE/H_iTbYvSTcs/s640/PopUpOverlay+Result.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Final Comments&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;As said, this can be used in many different scenarios: Update Progress, Quick Searchs, Master Detail pages, etc. Please feel free to try and change it. If you improve it, please share it. If you want to download a sample code, it will be soon available in my corresponding article at www.codeproject.com. Search by this post title or by nereo.lopez to find it. Hope it helps!&lt;br /&gt;&lt;br /&gt;Thanks for reading!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-2038031958974605679?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/2038031958974605679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2011/06/modal-popup-overlay.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/2038031958974605679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/2038031958974605679'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2011/06/modal-popup-overlay.html' title='Modal PopUp Overlay'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-eQVgyfUKI90/TfZr6lNI0eI/AAAAAAAAAG4/o3fswgf9U3k/s72-c/Html.png' height='72' width='72'/><thr:total>0</thr:total><georss:featurename>Sevilla, España</georss:featurename><georss:point>37.38263999999999 -5.9962950999999975</georss:point><georss:box>37.311115499999985 -6.118511099999997 37.45416449999999 -5.874079099999998</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-3455635557319164175</id><published>2011-04-12T08:51:00.002+02:00</published><updated>2011-11-16T06:52:25.106+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Code-Behind'/><title type='text'>Calling a code-behind function from javascript</title><content type='html'>Welcome back to my blog!&lt;br /&gt;&lt;br /&gt;As the title of this post says, today I want to share how to call a function or method in the code-behind from javascript, our in other words, run some server side code calling from the client, and then update our web page.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Background&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;I needed to add some functionality to some aspx pages so they would look more responsive, more like a desktop app. The thing is that I did not want to write the functionality in javascript. I wanted to implement something a little bit complex, but, as I already coded it in code-behind, why to rewrite it in javascript if it is possible to call that function or method from it?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Simple Scenario&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Lets imagine the following simple scenario, just with the purpose to show how&amp;nbsp;we&amp;nbsp;can achieve our goal today.&lt;br /&gt;Imagine that we have two text boxes: txtName and txtLastName. We want the user to write his Full Name and then greet him with a message when the last Text Box loses focus.&lt;br /&gt;&lt;br /&gt;We could easily do this all in javascript, but remember that it is just for the purpose of demonstrating how to call a server side method from our client side and update our web page.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The code&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Ok. Lets add three text boxes to our aspx page:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;&amp;lt;asp:TextBox&lt;/span&gt; &lt;span class="Apple-style-span" style="color: red;"&gt;ID&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;="txtName"&lt;/span&gt; &lt;span class="Apple-style-span" style="color: red;"&gt;runat&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;="server"&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;&amp;lt;asp:TextBox&lt;/span&gt; &lt;span class="Apple-style-span" style="color: red;"&gt;ID&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;="txtLastName"&lt;/span&gt; &lt;span class="Apple-style-span" style="color: red;"&gt;runat&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: blue;"&gt;"server"&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;&amp;lt;asp:TextBox&lt;/span&gt; &lt;span class="Apple-style-span" style="color: red;"&gt;ID&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;="txtMsg"&lt;/span&gt; &lt;span class="Apple-style-span" style="color: red;"&gt;runat&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;="server"&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Now, inside our body tag lets add some javascript:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;script&lt;/span&gt; &lt;span class="Apple-style-span" style="color: red;"&gt;type&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;function &lt;/span&gt;greet(txtN, txtLastN, txtMsg){&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;var &lt;/span&gt;ctrlN = document.getElementById(txtN);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;var &lt;/span&gt;ctrlLastN = document.getElementById(txtLastN);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;var &lt;/span&gt;fullName = ctrlN.value + ' &amp;nbsp;' + ctrlLastN.value;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PageMethods.greetUser(fullName, greetSuccess, greetFailed, txtMsg);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;function&lt;/span&gt; greetSuccess(res, txtMsg) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;var &lt;/span&gt;ctrlTxtMsg = document.getElementById(txtMsg);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ctrlTxtMsg.value = res;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;function&lt;/span&gt; greetFailed(res, dst) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert(res.get_message());&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;script&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;We just created three functions.:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Greet. Receives the ClientId of the txtName, txtLastName and txtMsg textboxes. Then it gets the objects for txtName and txtLastName, concats their value and calls our code-behind function "greetUser". We are passing to that function 4 values: the full name we've got by concatenating txtName and txtLastName values, the function wich will be call if everything goes ok, the function wich is going to be called if something failes and we can pass whatever we want in the last parameter, in this case, the ClientId of txtMsg text box.&lt;b&gt;Notice that "greetUser" is our code-behind function and that we are using PageMethods to have access to it.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;GreetSuccess is the function that is going to be called if everything went ok. Receives the result of the code-behind function and a parameter: the ClientID of the txtMsg text box, so we can get the object itself and assign to it the result of the code-behind function as its value.&lt;/li&gt;&lt;li&gt;GreetFailed. Receives the same 2 parameters than GreetSuccess. In this case, we are just going to show an alert with the error that happened.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Now, lets see our code behind. First in our Page_Load method we'll add:&lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;If&lt;/span&gt; Page.IsPostBack = False &lt;span class="Apple-style-span" style="color: blue;"&gt;Then&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;txtLastName.Attributes.Add(&lt;span class="Apple-style-span" style="color: red;"&gt;"onblur"&lt;/span&gt;, "&lt;span class="Apple-style-span" style="color: blue;"&gt;javascript:greet('&lt;/span&gt;" &amp;amp; txtName.ClientID &amp;amp; "','" &amp;amp; txtLastName.ClientID &amp;amp; "','" &amp;amp; txtMsg.ClientID &amp;amp; "')")&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;End If&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Why I'm assigning the attribut "onblur" to our txtLastName text box in our code instead of doing it directly in the aspx page? Just for demonstration.You could add this attribute from the aspx page, but if you had a more complex scenario, lets say a GridView, or a DataList with DataTemplates or if you are creating &amp;nbsp;controls dynamically... then you could for example get the control you need from code in the GridView_DataBound method or in the function you are creating your dynamic layout, and call the javascript function the way is shown above.&lt;br /&gt;&lt;br /&gt;Ok, here comes the important part of the article. The code behind function that we are calling from javascript.&lt;br /&gt;&lt;br /&gt;&amp;lt;System.Web.Services.&lt;span class="Apple-style-span" style="color: #6fa8dc;"&gt;WebMethod&lt;/span&gt;()&amp;gt; _&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;Public Shared Function&lt;/span&gt; greetUser(&lt;span class="Apple-style-span" style="color: blue;"&gt;ByVal&lt;/span&gt; fullName &lt;span class="Apple-style-span" style="color: blue;"&gt;As String) As String&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;Return &lt;/span&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;"Welcome "&lt;/span&gt; &amp;amp; fullName &amp;amp;&lt;span class="Apple-style-span" style="color: red;"&gt; "!"&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;End Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Please notice that we are giving this function the System.Web.Services.WebMethod attribute, this is the reason why we can access this function from javascript using PageMethods. In this function we are receiving the full name that we got joining the values from txtName and txtLastName in our "greet" javascript function.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Final words&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;I guess that's it. This was a really simple scenario, but you could think of really complex operations inside a gridview for example, or whatever other situation. As ever, please feel free to leave your comments, questions, suggestions or whatever you want to tell. Thanks for reading!&lt;br /&gt;&lt;br /&gt;Hope it helps!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-3455635557319164175?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/3455635557319164175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2011/04/calling-code-behind-function-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/3455635557319164175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/3455635557319164175'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2011/04/calling-code-behind-function-from.html' title='Calling a code-behind function from javascript'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-351705862062074301</id><published>2011-03-01T16:54:00.000+01:00</published><updated>2011-03-01T16:54:38.736+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sql Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Sql Injection'/><category scheme='http://www.blogger.com/atom/ns#' term='Sql Parameters'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Transactions'/><title type='text'>Transactions With Parameters 2 (Standard Solution)</title><content type='html'>Welcome back to my Blog!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://nereolopez.blogspot.com/2011/02/transactions-with-parameters.html"&gt;In my last article&lt;/a&gt; I shared code to be able to use parameters with transactions. &lt;b&gt;I received some comments&lt;/b&gt; saying that transactions should be handled in database and not in code. And they are completely right under my understanding. &lt;b&gt;My explanation to them about why I made this&lt;/b&gt; if I think the same as them was the following:&lt;br /&gt;&lt;br /&gt;"Sometimes we are not able to manage or alter databases but we still should do our best, and in these cases, we need to do it from code. So having a standard function to use parameters with transactions from our code would help us to still prevent data errors and securing our solution."&lt;br /&gt;&lt;br /&gt;&lt;b&gt;A more standard function&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;If you read my last article you probably remember that it was a first approach and that we could use it only in a scenario: when we need to commit the same query multiple times but with different values.&lt;br /&gt;&lt;br /&gt;This time I want to share something that is not limited to a single scenario. This is just a sample, so if you want to make it more efficient, or faster, you can modify it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Why is this helpful?&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;When we are not able to manipulate the database and we need to integrate with a closed solution (for example) (so we are not able to set up transactions from database) we often have classes to manage our database and retrive and commit data from and towards it.&lt;br /&gt;When we have to handle only a query it is easy. We have a command object, we add parameters to it, we assign them values and we execute the query. But when we need to handle multiple queries at once we usually have a function that uses transactions to handle it, but still using parameters is a pain. So now we'll have the ability to manage multiple queries using parameters, no matter how many queries are we going to commit. Even more, we don't even need to know what the queries are going to be, we could handle it dynamically and it still would work!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The code&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;A. Transaction function&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh3.googleusercontent.com/-K43YK_ojyW0/TW0OWMN5vYI/AAAAAAAAAGc/ewSQj6DHMoU/s1600/TryTransactionWithParamsAndQueries.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="220" src="https://lh3.googleusercontent.com/-K43YK_ojyW0/TW0OWMN5vYI/AAAAAAAAAGc/ewSQj6DHMoU/s400/TryTransactionWithParamsAndQueries.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;This function receives four things that we need to commit the transactions:&lt;br /&gt;1) Connection String&lt;br /&gt;2) An array with Sql Command Objects&lt;br /&gt;3) A datatable with the Sql Queries&lt;br /&gt;4) A datatable with the values&lt;br /&gt;&lt;br /&gt;We create the Sql Connection Object, we pass to its constructor the Connection String and we open the connection. Right after that we create the Sql Transaction Object and we start the transaction.&lt;br /&gt;&lt;br /&gt;Now, we just simply loop through our Queries Datatable. For each row of our Queries Datatable we passed, a Sql Command Object in our Command Array with the needed &amp;nbsp;parameters was passed, &amp;nbsp;and the corresponding values in the same order in our Values Datatable too. We'll just have a nested loop through the parameters of the associated Sql Command Object to the current query to assing it its value.&lt;br /&gt;&lt;br /&gt;Notice that Values Datatable has only a column, that's why we use the variable posValue, to keep track of the following row we need to be positioned at.&lt;br /&gt;&lt;br /&gt;After all the parameters for this query were assigned we just execute the query. Once all the queries were configured we commit the transaction to the database.&lt;br /&gt;&lt;br /&gt;All this code is inside a Try-Catch block to be able to rollback if something went wrong.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;B. Calling code&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh6.googleusercontent.com/-JHyttlLYyik/TW0Qxb2DCpI/AAAAAAAAAGg/diFng3fSKZg/s1600/Calling+TryTransactionWithParamsAndQueries.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="https://lh6.googleusercontent.com/-JHyttlLYyik/TW0Qxb2DCpI/AAAAAAAAAGg/diFng3fSKZg/s400/Calling+TryTransactionWithParamsAndQueries.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;In the calling code we just need to prepare the objects that we are going to pass as parameters to the Transaction Function.&lt;br /&gt;&lt;br /&gt;We first create our Queries Datatable with a column called "Query". We'll add as many rows as needed with the Sql Queries we want to execute.&lt;br /&gt;&lt;br /&gt;After that we'll create our Command Array. Its length is going to be the number of rows our Queries Datatable has. We'll create a Sql Command Object with its corresponding parameters added for each query, and we'll add them to the Command Array in the same order as their corresponding queries were added to our Queries Datatable.&lt;br /&gt;&lt;br /&gt;As we are going to have (in most cases) different number of parameters for each query, our Values Datatable will have only a column called "Value" and we'll add a row for each value of each query that we have. It is IMPORTANT that the values are added in the same order as the parameters.&lt;br /&gt;&lt;br /&gt;Now we are ready to call our Transaction Function.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Final words&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Well, we now have a standard function to use in different scenarios and we are able now to use Sql Parameters within Transactions having different queries and parameters. If there's any question, concern, suggestion or something, please feel free to leave a comment. Hope it helps.&lt;br /&gt;&lt;br /&gt;Thanks for reading!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-351705862062074301?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/351705862062074301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2011/03/transactions-with-parameters-2-standard.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/351705862062074301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/351705862062074301'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2011/03/transactions-with-parameters-2-standard.html' title='Transactions With Parameters 2 (Standard Solution)'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh3.googleusercontent.com/-K43YK_ojyW0/TW0OWMN5vYI/AAAAAAAAAGc/ewSQj6DHMoU/s72-c/TryTransactionWithParamsAndQueries.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-8564113569134536688</id><published>2011-02-21T16:55:00.007+01:00</published><updated>2011-02-23T09:58:57.324+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sql Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Sql Injection'/><category scheme='http://www.blogger.com/atom/ns#' term='Sql Parameters'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Transactions'/><title type='text'>Transactions With Parameters</title><content type='html'>Hi everyone,&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;welcome back to my blog. This time I want to share something about commiting multiple queries to the database with the ability of rolling back if one of them fails (we all know transactions) but taking advantage of the goodness of sql parameters.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Background (Why I coded it)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I had a function that received a connection string and an array containing sql queries to execute, and that function handled the transaction. Everything was happiness with MySql and this function working together. No errors, no problems, until I started using Ms Sql instead.&lt;br /&gt;My first error came when trying to execute a query with a date. Something like "cannot convert string into date type" appeared when debugging.&lt;br /&gt;As queries are being passed in an array, would be a mess to try to find values in the query, see if it's a date, cast it, and reconstruct our query. So the reasonable solution for me seemed to be using sql parameters. This solution not only solves the error I was facing, but also gives us security from sql injection, validation between data and types, etc...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Code&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;A.&lt;b&gt;The calling code to the TryTransactionWithParams Function&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-g2d8mkU7hio/TWKOcha-pxI/AAAAAAAAAGY/MoDDkIFRXrk/s1600/Calling+TryTransactionWithParams.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="364" src="http://1.bp.blogspot.com/-g2d8mkU7hio/TWKOcha-pxI/AAAAAAAAAGY/MoDDkIFRXrk/s400/Calling+TryTransactionWithParams.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is just a sample code. I just hard-coded values and number of queries that we are going to have for demonstration, but you can modify this for a real scenario where you don't know how many queries are you going to have.&lt;br /&gt;We are just creating a SqlCommand object and giving it parameters for the fields we are going to insert/update. Now we create a datatable where we are going to store the values for the parameters for each query(as said, this is just a sample and I hard-coded two transactions: row1and row2)&lt;br /&gt;It is not shown in the picture but there's a string called "sql" wich contains the sql query that we want to execute, in this case, would be something like "INSERT INTO table (Field1,Field2,Field3,Field4,Field5) VALUES(@Field1,@Field2,@Field3,@Field4,@Field5)"&lt;br /&gt;Now, we just call the function TryTransactionWithParams. This function receives four parameters:&lt;br /&gt;1) Connection String&lt;br /&gt;2) Sql Command Object&lt;br /&gt;3) Sql Query&lt;br /&gt;4) A datatable with the values for each query.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;A.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;The TryTransactionWithParams Function&lt;/b&gt;&lt;/span&gt; &lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-M22Zodz0X4k/TWKHZmkEOeI/AAAAAAAAAGU/aUeGdg4QCyc/s1600/tryTransactionWithParams.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="230" src="http://1.bp.blogspot.com/-M22Zodz0X4k/TWKHZmkEOeI/AAAAAAAAAGU/aUeGdg4QCyc/s400/tryTransactionWithParams.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This function receives the parameters mentioned above. Let's take a look at it.&lt;br /&gt;First, we create the Sql Connection Object and we open the connection. After that we start the transaction.&lt;br /&gt;Now, let's add to the Sql Command Object that we passed as a parameter some properties, such as the Sql Query, the Transaction Object and the Connection Object.&lt;br /&gt;&lt;br /&gt;After that, we just create a nested loop, in wich we give the corresponding values to the Command Parameters. Once all values for a query are given, we execute it and loop to the next query (or row of the datatable where values are stored)&lt;br /&gt;&lt;br /&gt;After the nested loop is done, we just commit the transaction. If fails, we'll just rollback so no changes are made in our database. All or nothing!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;b&gt;Extend It!&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Please notice the following. You may say that this sample works only for cases where we have to commit the same Sql Query but with different values (as my scenario). It is true. But you can easily extend the functionality of this function. All is needed is to pass a collection (in an array, or in a DataTable, or in whatever you prefer) to the function and loop through it appropiately, as we did with the values we passed or as we did with the Sql Command Object.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Final words&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Notice that this sample works with MS Sql, but making small changes would work with MySql.&lt;br /&gt;Where parameters appear replace "@" with"?". And when specifying parameter types replace "SqlDbType" with "MySqlDbType".&lt;br /&gt;&lt;br /&gt;Well, that's it. Now we have a function, that receiving the appropiate parameters, will execute a bunch of queries taking advantage of the goodnes of Sql Parameters. If there's any question, concern, suggestion or something, please feel free to leave a comment. Hope it helps.&lt;br /&gt;&lt;br /&gt;Thanks for reading!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-8564113569134536688?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/8564113569134536688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2011/02/transactions-with-parameters.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/8564113569134536688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/8564113569134536688'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2011/02/transactions-with-parameters.html' title='Transactions With Parameters'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-g2d8mkU7hio/TWKOcha-pxI/AAAAAAAAAGY/MoDDkIFRXrk/s72-c/Calling+TryTransactionWithParams.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-1979939759209443179</id><published>2011-01-21T09:49:00.000+01:00</published><updated>2011-01-21T09:49:54.343+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Error'/><category scheme='http://www.blogger.com/atom/ns#' term='Sql Server'/><title type='text'>MS Sql Server 2008 error: "Saving changes is not permitted"</title><content type='html'>Hi everyone,&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Problem&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I'm kinda used to work with MySql, but for a new project MS Sql Server was required. Actually, I'm using R2 (express) version.&lt;br /&gt;&lt;br /&gt;After creating a table and realizing that I had made a mistake, I opened the table design view again and made some changes. But what a surprise when after clicking Save button an error message was displayed:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;"Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created."&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_5qeILST8nko/TTlFlft_V3I/AAAAAAAAAF8/vDRfSWb2LgE/s1600/ErrorEditingTable.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="254" src="http://1.bp.blogspot.com/_5qeILST8nko/TTlFlft_V3I/AAAAAAAAAF8/vDRfSWb2LgE/s320/ErrorEditingTable.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Couldn't believe that I need to drop and re-create a table every time I need to make a change in the table definition. MySql doesn't work like that, so I'm sure there's a way to avoid this in MS Sql Server also, otherwise, it has no sense for me.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Solution&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;After dropping 2 tables and re-created them I thought that I couldn't be doing that the whole project, so after&amp;nbsp;reading carefully the error message, I thought about the last sentence: &lt;i&gt;the option Prevent saving changes that require the table to be re-created.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;I started to look in the options, and found one that says exactly the same as this last sentence of the error message.&lt;br /&gt;&lt;br /&gt;Open Sql Server Management Studio and go to Tools-&amp;gt; Options -&amp;gt; Designers -&amp;gt; Table and Database Designers -&amp;gt; Uncheck Prevent saving changes that require table re-creation&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_5qeILST8nko/TTlHbylUubI/AAAAAAAAAGA/HuwKxQKJQpk/s1600/ChangingSetting.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232" src="http://1.bp.blogspot.com/_5qeILST8nko/TTlHbylUubI/AAAAAAAAAGA/HuwKxQKJQpk/s400/ChangingSetting.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;That solved the problem. So now you are able to make changes in your table definition without having to drop it any time you want to make a change.&lt;br /&gt;&lt;br /&gt;As ever, please feel free to leave any comments, suggestions or questions.&lt;br /&gt;&lt;br /&gt;Thanks for reading!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-1979939759209443179?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/1979939759209443179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2011/01/ms-sql-server-2008-error-saving-changes.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/1979939759209443179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/1979939759209443179'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2011/01/ms-sql-server-2008-error-saving-changes.html' title='MS Sql Server 2008 error: &quot;Saving changes is not permitted&quot;'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_5qeILST8nko/TTlFlft_V3I/AAAAAAAAAF8/vDRfSWb2LgE/s72-c/ErrorEditingTable.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-7956035855765830825</id><published>2011-01-15T22:17:00.001+01:00</published><updated>2011-01-15T22:45:02.664+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Search'/><category scheme='http://www.blogger.com/atom/ns#' term='Search Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Google Search'/><title type='text'>Search your web page with Google's Engine</title><content type='html'>Hi Everyone,&lt;br /&gt;&lt;br /&gt;this time I want to show how you can add a search text box in your Web Page using Google's Search Engine, so you can get Full Search Functionality without writing any code, NO MATTER THE PROGRAMMING LANGUAGE YOU ARE USING.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;HTML CODE&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;form action="http://www.google.com/search" method="get" name="searchform" &amp;nbsp; target="_blank"&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;table border="0" cellpadding="0" cellspacing="0"&amp;gt;&amp;lt;tbody&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;tr&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;td&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;input name="sitesearch" type="hidden" value="http://nereolopez.blogspot.com" /&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/td&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;td&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;input alt="search" name="as_q" size="20" type="text" value="Search this web" /&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/td&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;td&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;input title="Search" type="submit" value="Search" /&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/td&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;/tr&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;/tbody&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;/table&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;/form&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;EXPLANATION&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;This is just an HTML form wich contains a hidden field with the url where we want google to search, an imput (TextBox) where user can input what he/she wants to search, and a submit button.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The ACTION of the form is the Google's Search Engine url and will be open in a new tab in the browser when user clicks the submit button. As we are using the GET method, the resulting url would be something like this&lt;b style="font-weight: bold;"&gt;:&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;b&gt;&lt;a href="http://www.google.com/search?sitesearch=nereolopez.blogspot.com&amp;amp;as_q=silverligth"&gt;http://www.google.com/search?sitesearch=nereolopez.blogspot.com&amp;amp;amp;as_q=silverligth&lt;/a&gt;&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;WORKING EXAMPLE&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;If you want to check how it works, just check this &lt;a href="http://nereolopez.blogspot.com/2011/01/search-your-web-page-with-google-engine_3117.html"&gt;example.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope you guys like it. As ever, please feel free to leave any comment, suggestion or question.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks for reading!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-7956035855765830825?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/7956035855765830825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2011/01/search-your-web-page-with-google-engine.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/7956035855765830825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/7956035855765830825'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2011/01/search-your-web-page-with-google-engine.html' title='Search your web page with Google&apos;s Engine'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-3212662901217286127</id><published>2011-01-15T22:06:00.004+01:00</published><updated>2011-01-15T22:46:15.177+01:00</updated><title type='text'>Search your web page with Google's Engine (Example)</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;this is the working example of the previous article &lt;a href="http://nereolopez.blogspot.com/2011/01/search-your-web-page-with-google-engine.html"&gt;Search your web page with Google's Engine&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;form action="http://www.google.com/search" method="get" name="searchform" target="_blank"&gt;&lt;table border="0" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;         &lt;td&gt;&lt;br /&gt;&lt;input name="sitesearch" type="hidden" value="http://nereolopez.blogspot.com" /&gt;&lt;/td&gt;         &lt;td&gt;&lt;br /&gt;&lt;input alt="search" name="as_q" size="20" type="text" value="Search this web" /&gt;&lt;/td&gt;          &lt;td&gt;&lt;br /&gt;&lt;input title="Search" type="submit" value="Search" /&gt;&lt;/td&gt;        &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/form&gt;&lt;br /&gt;Hope you like it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-3212662901217286127?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/3212662901217286127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2011/01/search-your-web-page-with-google-engine_3117.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/3212662901217286127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/3212662901217286127'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2011/01/search-your-web-page-with-google-engine_3117.html' title='Search your web page with Google&apos;s Engine (Example)'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-4600337111341453590</id><published>2010-12-10T17:08:00.001+01:00</published><updated>2011-08-26T15:42:07.733+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Twitter'/><title type='text'>Twitter Trasparent SideBar</title><content type='html'>Hi everyone!&lt;br /&gt;&lt;br /&gt;I just &lt;a href="http://www.justinparks.com/twitter-profile-sidebar-transparent/"&gt;found a nice script&lt;/a&gt; to make our twitter side bar (where our profile, followers, lists... are shown) trasparent.&lt;br /&gt;&lt;br /&gt;Being logged in twitter, go to Settings -&amp;gt; Design (Configuración -&amp;gt;Diseño) and write in the Web Browser's address bar the following:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 16px; line-height: 22px;"&gt;javascript:d=document;c=d.createElement('script');d.body.appendChild(c);c.src='http%3A%2F%2Fwww.justinparks.com%2Ftwitter%2Ftwitter-sidebar.js';void(0);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now, click on save changes... Your Twitter SideBar should be trasparent now.&lt;br /&gt;&lt;br /&gt;Hope you guys like it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-4600337111341453590?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/4600337111341453590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2010/12/twitter-sidebar-trasparent.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/4600337111341453590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/4600337111341453590'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2010/12/twitter-sidebar-trasparent.html' title='Twitter Trasparent SideBar'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-1818677642547478599</id><published>2010-12-04T21:31:00.003+01:00</published><updated>2010-12-08T13:02:02.618+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Twitter'/><title type='text'>Displaying Twitter (tweets) in Asp.Net</title><content type='html'>Hi everyone!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Background&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Again this article is the fruit of a need I had. I've been searching for a couple of days how to show social networks' updates (from twitter, youtube, facebook...) and after getting a terrible headache, I decided to do it myself. And I want to share how I did it.&lt;br /&gt;&lt;br /&gt;The truth is that all this Social Networks have APIs that allow developers to integrate our applications with them, and they are great. There are also open source libraries that we could use (like "twitterizer"), and it works pretty well also. But the reality is that they have too many options and documentation to read... and (for me at least) was not worth it to spend that time when my requirement was as simple as showing my lastest tweets and videos in the company web page. I found a guy wondering in a forum how he couldn't find a simple example on how to do this same thing with this open source libraries or with the APIs, though I insist, to integrate whole applications, libraries and APIs are great!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What we'll do&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Well see Twitter this time, and we'll use Twitter's feed to get a user's timeline (the tweets he or she sent). Twitter returns the information in several formats (rss, xml, json...) and we'll talk about xml.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Let's see the code..&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;The variable "twitterUrl" that will be used in the code must be something like this:&lt;br /&gt;twitterUrl = "http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=nereolopez"&lt;br /&gt;&lt;br /&gt;".xml" can be replaced by the desired format, and screen name would be the twitter screen name that we want to retrieve, in this example, my own.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_5qeILST8nko/TPqd4o-lT8I/AAAAAAAAAFc/zXESWa5adUU/s1600/getTwitterInfo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="191" src="http://4.bp.blogspot.com/_5qeILST8nko/TPqd4o-lT8I/AAAAAAAAAFc/zXESWa5adUU/s320/getTwitterInfo.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_5qeILST8nko/TPqfG5BUVKI/AAAAAAAAAFg/Ppukxd28eok/s1600/twitterResult.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="205" src="http://4.bp.blogspot.com/_5qeILST8nko/TPqfG5BUVKI/AAAAAAAAAFg/Ppukxd28eok/s320/twitterResult.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Understanding the code&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Line 200: First, we create a WebClient to make a request. We pass the Url with the user we want to retrieve and the format.&lt;br /&gt;&lt;br /&gt;Lines202-203 :We create an XmlDocument and read the string to fill that document&lt;br /&gt;&lt;br /&gt;Lines 208-223: We create a datatable with three columns: Title, Date and Link.&lt;br /&gt;When we read our xml document into a dataset, we get three different tables: statuses, status and user.&lt;br /&gt;All the information that we want to display is in "status" table. We retrieve the date(position 0), the guid(position 1, with this we'll construct the link to the tweet itself), tweet (position 2), we could also use the source (posittion 3) but it's enough for this example.We'll also use the table "user" to get the user name to create the link. As we're iterating through the dataset's tables we extract the information we need to the datatable we created.&lt;br /&gt;&lt;br /&gt;Lines 225-227: I have a DataList in the aspx. You can create the layout you want. You can see the result of mine's in the picture above. In these lines of code we bind the DataTable we created to the DataList.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Final comments&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;I notice some differences between the strings that we obtain through xml and rss format. Apart from having a different schema, xml does not show the retweets in the timeline of that user. Another important thing is that we are not going to receive any information if the user's tweets are protected (private).&lt;br /&gt;&lt;br /&gt;Doing this with YouTube is similar. I will go on an article on it in a couple days.&lt;br /&gt;Thanks for reading and please feel free to make comments, suggestions, questions or whatever you want.&lt;br /&gt;&lt;br /&gt;Hope this helps!&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-1818677642547478599?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/1818677642547478599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2010/12/showing-twitter-tweets-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/1818677642547478599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/1818677642547478599'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2010/12/showing-twitter-tweets-in-aspnet.html' title='Displaying Twitter (tweets) in Asp.Net'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_5qeILST8nko/TPqd4o-lT8I/AAAAAAAAAFc/zXESWa5adUU/s72-c/getTwitterInfo.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-4346226904870274925</id><published>2010-10-25T08:50:00.000+02:00</published><updated>2010-10-25T08:50:20.332+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Feeds'/><category scheme='http://www.blogger.com/atom/ns#' term='Gmail'/><title type='text'>Consuming Feeds (Gmail Inbox Sample)</title><content type='html'>&lt;a href="http://www.codeproject.com/script/Articles/BlogFeedList.aspx?amid=6806978" rel="tag" style="display: none;"&gt;CodeProject&lt;/a&gt;&lt;br /&gt;Hi everyone!&lt;br /&gt;&lt;br /&gt;I was in the need of retreiving the unread messages from our email (we are using Google Apps). So I started to search on how to do this. I found that Google offers an inbox feed . That was great! The problem was that I had never consumed a feed before.&lt;br /&gt;&lt;br /&gt;I searched for documentation on how to do this and I found a &lt;a href="http://fci-h.blogspot.com/2009/09/reading-atom-feed-of-gmail-inbox-via-c.html"&gt;sample code&lt;/a&gt; that consumes the Gmail feed. It was written in C#. We have our web app developed with VB.Net so I had to translate the code. Was not working for me (probably I wasn't translating it well) so I just modified the sample code (though most of it is just the tranlsation).&lt;br /&gt;&lt;br /&gt;I'm going to post the whole thing, I mean, not only the part when we consume the atom feed, but how to convert and display the information we got. In this case, I'm using a DataList control. Let's take a look at the code.&lt;br /&gt;&lt;br /&gt;First, our Html with the DataList where we'll show our Unread Messages (It has just three columns to show the following fields: From, Subject, and Date)&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_5qeILST8nko/TMUlAJD1rNI/AAAAAAAAAFM/9KzixziEmy8/s1600/DataList.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="181" src="http://2.bp.blogspot.com/_5qeILST8nko/TMUlAJD1rNI/AAAAAAAAAFM/9KzixziEmy8/s400/DataList.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Second, the call to the class that will read the Atom Feed, and how we convert what this class returns to fill our DataList. (I just commented the fields that I don't want to show, if you want to use them, go ahead!)&lt;br /&gt;Code is simple, we instanciate the class GmailAtomFeed passing the email address and its password to the constructor. We call the GetGmailAtom function wich returns an Xml, and we pass it to a Dataset with one Datatable wich we'll be bound to the DataList...&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_5qeILST8nko/TMUlMKvwn2I/AAAAAAAAAFQ/zUSfZLueEds/s1600/Calling+the+Feed+Reader.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_5qeILST8nko/TMUlMKvwn2I/AAAAAAAAAFQ/zUSfZLueEds/s1600/Calling+the+Feed+Reader.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Third, the class itself that reads the Atom Feed&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_5qeILST8nko/TMUlT-px4KI/AAAAAAAAAFU/x2h4-QN2O0E/s1600/GmailAtomFeed1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_5qeILST8nko/TMUlT-px4KI/AAAAAAAAAFU/x2h4-QN2O0E/s1600/GmailAtomFeed1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_5qeILST8nko/TMUlcU3EioI/AAAAAAAAAFY/xWJgvhJs4js/s1600/GmailAtomFeed2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_5qeILST8nko/TMUlcU3EioI/AAAAAAAAAFY/xWJgvhJs4js/s1600/GmailAtomFeed2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;And that's it. Please feel free to leave any comment, suggestion or question. As I said, this is based on the sample code that I linked before in this post but with a small modification in the GmailAtomFeed class and a different output.&lt;br /&gt;&lt;br /&gt;Hope it helps!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-4346226904870274925?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/4346226904870274925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2010/10/consuming-feeds-gmail-inbox-sample.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/4346226904870274925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/4346226904870274925'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2010/10/consuming-feeds-gmail-inbox-sample.html' title='Consuming Feeds (Gmail Inbox Sample)'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_5qeILST8nko/TMUlAJD1rNI/AAAAAAAAAFM/9KzixziEmy8/s72-c/DataList.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-8195481427483712194</id><published>2010-10-23T17:25:00.000+02:00</published><updated>2010-10-23T17:25:24.148+02:00</updated><title type='text'>Language Change</title><content type='html'>Hi everyone!&lt;br /&gt;&lt;br /&gt;Just want to let you know that from now, all my articles are going to be in English for obvious reasons. If anyone has difficulties to understand any of the future posts, please feel free to ask.&lt;br /&gt;&lt;br /&gt;Thanks!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-8195481427483712194?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/8195481427483712194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2010/10/language-change.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/8195481427483712194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/8195481427483712194'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2010/10/language-change.html' title='Language Change'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-4523169993803691173</id><published>2010-08-06T18:10:00.003+02:00</published><updated>2010-08-06T18:15:08.203+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Google Maps'/><title type='text'>Asp.Net 4 y Google Maps</title><content type='html'>&lt;b&gt;Bienvenid@s de nuevo!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;No hace mucho escribí un pequeño artículo introductorio a Bing Maps con Silverlight 4. En esta ocasión vamos a ver cómo utilizar el servicio de geolocalización en Asp.Net, pero, esta vez, con Google.&lt;br /&gt;&lt;br /&gt;A diferencia de Bing Maps para Silverlight, no necesitamos descargarnos ningún control o librería. Google pone a nuestra disposición la API de sus mapas. Para este sencillo ejemplo, nos bastará con crear una función Javascript y un área reservada en nuestro Html donde cargaremos el mapa.&lt;br /&gt;&lt;br /&gt;Éste sería el código de ejemplo de nuestra sencilla página:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_5qeILST8nko/TFwwkvWa97I/AAAAAAAAAEQ/XWjvCfSjUks/s1600/Script+window_onload.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="636" src="http://3.bp.blogspot.com/_5qeILST8nko/TFwwkvWa97I/AAAAAAAAAEQ/XWjvCfSjUks/s640/Script+window_onload.png" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;Vamos a explicar el código que acabamos de ver.&lt;br /&gt;El origen (src) del script, es la API de Google Maps, y tiene la propiedad "sensor" igualada a "false" porque no vamos a usar localización.&lt;br /&gt;Lo siguiente que hace es guardar en una variable la latitud y longitud del punto que usaremos como central en el mapa (ver mi artículo &lt;a href="http://nereolopez.blogspot.com/2010/06/silverlight-4-y-bing-maps.html"&gt;Silverlight 4 y Bing Maps&lt;/a&gt;&amp;nbsp;para averiguar cómo conseguir las coordenadas)&lt;br /&gt;Creamos una variable donde guardamos las opciones que le pasaremos al constructor de la clase "map" cuando instanciemos el mapa. Las opciones que usamos son "zoom" (lo cerca o lejos que veremos el mapa), "center" (que es el punto central donde queremos que se vea el mapa inicialmente. Sevilla en nuestro ejemplo) y "mapTypeId" (que se corresponde con el tipo de vista que queremos mostrar en el mapa: híbrida, callejera, aérea...).&lt;br /&gt;A continuación instanciamos nuestro mapa, y al constructor de la clase le pasamos el elemento en nuestro Html que alojará el mapa, y las opciones que acabamos de definir.&lt;br /&gt;Las siguientes variables que se ven en el código (llamadas MarkerA, MarkerB...) las usaremos para poner sobre el mapa el típico globito rojo (o cualquier icono que queramos) que se usa para señalar una ubicación.&lt;br /&gt;Sólo debemos instanciarlos, darles un título, las coordenadas donde lo queremos mostrar, una imagen si queremos...)&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_5qeILST8nko/TFwy35_PhVI/AAAAAAAAAEg/2lR7jtnYiTU/s1600/Event+window_onload+declaration.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="108" src="http://1.bp.blogspot.com/_5qeILST8nko/TFwy35_PhVI/AAAAAAAAAEg/2lR7jtnYiTU/s640/Event+window_onload+declaration.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;Todavía en la cabecera de nuestro Html, decimos que la función que se va a ejecutar cuando la página se cargue es "onload" (que es la que vimos hace un momento).&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_5qeILST8nko/TFwzSnmcrwI/AAAAAAAAAEs/-pkTJvDvpfk/s1600/Div+map_canvas.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="36" src="http://1.bp.blogspot.com/_5qeILST8nko/TFwzSnmcrwI/AAAAAAAAAEs/-pkTJvDvpfk/s640/Div+map_canvas.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;Y ponemos en alguna parte de nuestro Html el área donde cargaremos nuestro mapa. Si recordáis, al instanciar el mapa le hemos pasado al constructor de la clase mapa este elemento Html.&lt;br /&gt;Cómo veis es bastante sencillo. Gracias por el tiempo que habéis dedicado a leer este artículo. Espero que os haya gustado. Sentíos libres de dejar comentarios/sugerencias/dudas...&lt;br /&gt;&lt;br /&gt;Si queréis verlo funcionando, podéis entrar en &lt;a href="http://www.copysevilla.com/"&gt;http://www.copysevilla.com/&lt;/a&gt; e ir al apartado Nosotros -&amp;gt; Dónde Estamos (estará disponible dentro de unos cinco días porque la estoy actualizando. También, en el pié de página tendréis un enlace a la versión en Silverlight para que veáis el resultado del articulo de Silverlight 4 y Bing Maps)&lt;br /&gt;&lt;br /&gt;Un abrazo.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-4523169993803691173?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/4523169993803691173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2010/08/aspnet-4-y-google-maps.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/4523169993803691173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/4523169993803691173'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2010/08/aspnet-4-y-google-maps.html' title='Asp.Net 4 y Google Maps'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_5qeILST8nko/TFwwkvWa97I/AAAAAAAAAEQ/XWjvCfSjUks/s72-c/Script+window_onload.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-1480777067240279925</id><published>2010-08-06T17:46:00.000+02:00</published><updated>2010-08-06T17:46:53.624+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Encriptar'/><title type='text'>Encriptar en Silverlight</title><content type='html'>&lt;b&gt;Buenas tardes a tod@s!&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Este pequeño artículo sólo pretende compartir de manera breve cómo encriptar/desenciptar en Silverlight 4, ya que es un poco diferente a la forma de trabajar con ello en Vb.Net/C#/Asp.Net para los que estábamos acostumbrados a ello.&lt;br /&gt;A continuación dejo un ejemplo muy sencillo hecho en Vb.Net como propósito de demostración, con los comentarios ya puestos en el código.&lt;br /&gt;&lt;br /&gt;En este ejemplo, pasamos la contraseña de inicio de sesión de un usuario, y la encriptamos porque la vamos a enviar a un servicio web para autenticarlo.&lt;br /&gt;&lt;img border="0" bx="true" height="131" src="http://4.bp.blogspot.com/_5qeILST8nko/TFwrrEAFj5I/AAAAAAAAADM/qzDjcBjwD1g/s640/Calling+Encrypt+Function.png" width="640" /&gt;&lt;br /&gt;&lt;br /&gt;A continuación pongo la clase que contiene las&amp;nbsp;funciones que se mencionan en la imagen de arriba:&amp;nbsp;la que crea la clave,&amp;nbsp;la que encripta, y la que desencripta.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_5qeILST8nko/TFwsIIV1IEI/AAAAAAAAADU/WBwHP4jUxZo/s1600/Security+Class+-+GetHashKey.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="438" src="http://4.bp.blogspot.com/_5qeILST8nko/TFwsIIV1IEI/AAAAAAAAADU/WBwHP4jUxZo/s640/Security+Class+-+GetHashKey.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_5qeILST8nko/TFwsNaLd_HI/AAAAAAAAADc/mnlByDsP4HU/s1600/Security+Class+-+Encrypt.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="326" src="http://1.bp.blogspot.com/_5qeILST8nko/TFwsNaLd_HI/AAAAAAAAADc/mnlByDsP4HU/s640/Security+Class+-+Encrypt.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_5qeILST8nko/TFwtfjwfeGI/AAAAAAAAADs/WHag0wuArzI/s1600/Security+Class+-Decrypt.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="324" src="http://4.bp.blogspot.com/_5qeILST8nko/TFwtfjwfeGI/AAAAAAAAADs/WHag0wuArzI/s640/Security+Class+-Decrypt.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Gracias por el tiempo que habéis dedicado a leer este artículo. Espero que os haya gustado. Sentíos libres de dejar comentarios/sugerencias/dudas...&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Un abrazo.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-1480777067240279925?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/1480777067240279925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2010/08/encriptar-en-silverlight.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/1480777067240279925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/1480777067240279925'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2010/08/encriptar-en-silverlight.html' title='Encriptar en Silverlight'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_5qeILST8nko/TFwrrEAFj5I/AAAAAAAAADM/qzDjcBjwD1g/s72-c/Calling+Encrypt+Function.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-3116354891424167743</id><published>2010-06-26T13:16:00.001+02:00</published><updated>2010-06-26T13:40:04.374+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Bing Maps'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4'/><title type='text'>Silverlight 4 y Bing Maps</title><content type='html'>&lt;div align="left" class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;Bienvenidos nuevamente a mi Blog!&lt;br /&gt;&lt;br /&gt;En esta ocasión me gustaría compartir mi pequeña experiencia en combinar la potencia de Silverlight con los Mapas de Bing. Hay muchas utilidades que le podemos dar. Quizás las más utilizadas son: permitir al usuario buscar una localización determinada y mostrársela en el mapa y el típico "Dónde Estamos". En nuestro caso, hoy, vamos a hacer un pequeño ejemplo del segundo.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Lo primero que necesitamos es descargar el control de Bing Maps para Silverlight. En lugar de&amp;nbsp;dejar el link (que variará con las futuras versiones) creo que si ponéis en un buscador "download silverlight bing maps", encontraréis el enlace de la versión más reciente.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Instalamos el .msi que hemos descargado. Si nos fijamos en C:\Archivos de Programa, ahora hay una carpeta para el Bing Maps Silverlight Control; dentro encontraremos la documentación y las librerías que necesitamos incorporar a nuestro proyecto, así que, vamos a ello.&lt;/div&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Vamos a nuestro proyecto en Visual Studio (2010) y en Proyecto-&amp;gt;Añadir Referencia, nos vamos a la pestaña "Explorar" y buscamos la carpeta de las librerías dentro del directorio donde se ha instalado el control de Bing Maps para Silverlight.&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_5qeILST8nko/TCXX3p_zMzI/AAAAAAAAACs/hS1fAgdEXdU/s1600/AddReference.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ru="true" src="http://1.bp.blogspot.com/_5qeILST8nko/TCXX3p_zMzI/AAAAAAAAACs/hS1fAgdEXdU/s320/AddReference.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;A continuación, añadimos el espacio de nombres a la página donde queramos insertar el control, en nuestro caso, en DondeEstamos.xaml.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_5qeILST8nko/TCXZCOQAXxI/AAAAAAAAAC0/ZsAtWVlxXv8/s1600/AddNameSpace.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ru="true" src="http://4.bp.blogspot.com/_5qeILST8nko/TCXZCOQAXxI/AAAAAAAAAC0/ZsAtWVlxXv8/s320/AddNameSpace.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Ahora ya estmos en disposición de utilizar el mapa en nuestra página:&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_5qeILST8nko/TCXZ1a5P68I/AAAAAAAAAC8/_0gpTReVXM8/s1600/MapXaml.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ru="true" src="http://4.bp.blogspot.com/_5qeILST8nko/TCXZ1a5P68I/AAAAAAAAAC8/_0gpTReVXM8/s320/MapXaml.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Veamos las propiedades que hemos definido (obviando las de Layout que tiene en común con todos los demás controles):&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Credentials Provider: De momento, en la Beta de la v1 del control, debemos registrar nuestra aplicación para obtener una credencial que nos permita usar el mapa. Podemos registrar hasta 5 aplicaciones. El código que nos da es el que debemos poner en Credentials Provider (para más información: &lt;a href="http://www.bingmapsportal.com/"&gt;http://www.bingmapsportal.com/&lt;/a&gt;)&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Center: El punto (longitud y latitud) central en el que queremos que aparezca el mapa por defecto.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;CopyrightVisibility: para mostrar u ocultar el copyright del mapa.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Culture: el idioma que queremos para el mapa.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;LogoVisibility: para mostrar u ocultar el logo de Bing Maps.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;ZoomLevel: La distancia a la que queremos que se vea el mapa (1 es el más lejano)&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;strong&gt;¿Cómo obtenemos la longitud y la latitud de una dirección? &lt;/strong&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Esto nos hará falta para centrar el mapa en su posición inicial y para saber dónde está una de nuestras localizaciones. Vamos a Bing Maps. Buscamos la dirección que nos interesa, y nos mostrará el resultado justo en el centro. Ahora, en la barra del navegador, escribimos: &lt;strong&gt;javascript:map.GetCenter()&lt;/strong&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Nos devolverá algo como esto: (37.38763567060232, -6.001807451248169)&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Si queremos que sea nuestro centro, sólo tenemos que ponerlo en la propiedad Center del control sin los paréntesis y sin espacio después de la coma.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;strong&gt;Situando nuestras localizaciones&lt;/strong&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Creo que si vemos el código, será fácil de entender:&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_5qeILST8nko/TCXeYCqBblI/AAAAAAAAADE/yfApmxq0uGo/s1600/MapChildren.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ru="true" src="http://1.bp.blogspot.com/_5qeILST8nko/TCXeYCqBblI/AAAAAAAAADE/yfApmxq0uGo/s320/MapChildren.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Si se llega a apreciar, nosotros podemos declarar una sección de "hijos" para el mapa. En este caso, crearé un Canvas para cada hijo. Al canvas le decimos la posición en el mapa que va a tener (Canvas m:MapLayer.Position="37.38863651666282,-5.998246089008944"), y, sacándole partido a la flexibilidad y potencia de xaml, creamos lo que nuestra imaginación desee (en este caso, es simplemente un borde trasparente, con una imagen&amp;nbsp;de un globo similar al de los mapas de siempre, pero podríamos utilizar rotaciones, efectos, triggers...)&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Podemos añadir tantos "hijos"&amp;nbsp;como queramos, y lo que queramos. Por supuesto, creo que lo más interesante es poder crear nuestro mapa de manera dinámica, en el código, tirando de un origen de datos.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Gracias por el tiempo que habéis dedicado a leer este artículo.Espero que os haya gustado. Sentíos libres de dejar comentarios/sugerencias/dudas...&amp;nbsp;Quizá otro día hablemos del otro caso más común, que es permitir al usuario introducir una dirección y mostrársela en el mapa.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Un abrazo!&lt;br /&gt;&lt;br /&gt;(para más información: &lt;a href="http://www.microsoft.com/maps/isdk/silverlight/"&gt;http://www.microsoft.com/maps/isdk/silverlight/&lt;/a&gt;)&lt;/div&gt;&lt;div align="left" class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-3116354891424167743?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/3116354891424167743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2010/06/silverlight-4-y-bing-maps.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/3116354891424167743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/3116354891424167743'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2010/06/silverlight-4-y-bing-maps.html' title='Silverlight 4 y Bing Maps'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_5qeILST8nko/TCXX3p_zMzI/AAAAAAAAACs/hS1fAgdEXdU/s72-c/AddReference.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-5647296118843339593</id><published>2010-05-31T22:21:00.002+02:00</published><updated>2010-06-26T12:03:13.642+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Deploy'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS7'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Net Framework 4'/><title type='text'>Cómo Publicar Silverlight 4 con datos</title><content type='html'>Buenas noches! &lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;Estuve una semana dándole vueltas a por qué mi aplicación de Silverlight 4 publicada en Windows 7 con IIS 7.5 me daba el siguiente error:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;"System.ServiceModel.DomainServices.Client.DomainOperationException: Load operation failed fore query 'GetProducts'.... Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed"&lt;/em&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Para mí fue un dolor de cabeza hasta arreglarlo. Así que aquí lo dejo por si alguien se encuentra en la misma tesitura.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Hemos creado nuestra aplicación de Silverlight, con la versión 4 (en Visual Studio 2010). Consta de algunas vistas y está enlazada a datos (en este caso, a una base de datos mdf puesta en el directorio App_Data del proyecto Web de nuestra Solución)&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_5qeILST8nko/TAQQmlTS5TI/AAAAAAAAAB0/UWi6ilhFEXQ/s1600/Solution+Explorer.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" gu="true" src="http://3.bp.blogspot.com/_5qeILST8nko/TAQQmlTS5TI/AAAAAAAAAB0/UWi6ilhFEXQ/s320/Solution+Explorer.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Imaginemos que está terminada. Vamos a publicarla. El procedimiento es muy similar a cuando publicábamos nuestra aplicación en Asp.Net. Hacemos Click con el botón derecho del ratón sobre el proyecto web (una vez que hemos compilado y que no hay errores) y en el menú contextual elegimos "publicar".&lt;br /&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_5qeILST8nko/TAQRhZ4JDsI/AAAAAAAAAB8/XykITJkRVOA/s1600/Publish.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" gu="true" src="http://1.bp.blogspot.com/_5qeILST8nko/TAQRhZ4JDsI/AAAAAAAAAB8/XykITJkRVOA/s320/Publish.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;En la ventana emergente que aparece, aunque es nueva, es intuitiva. Podemos crear "plantillas" de publicación. Elegimos dónde vamos a publicar nuestra aplicación (en local, servidor web, ftp...), si queremos reemplazar los archivos en el destino si ya hemos hecho una publicación antes o eliminarlos antes de hacer la nueva (recomiendo esta segunda) y publicamos sin más.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Ahora viene la parte más "divertida". En mi caso, estoy utilizando un Windows 7 con IIS 7.5&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Abrimos el menú inicio de Windows y escribimos en la búsqueda "inetmgr" para abrir el gestor de IIS.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Primero nos vamos a los Tipos MIME.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_5qeILST8nko/TAQUsxYOQfI/AAAAAAAAACE/iZoCgxTebEI/s1600/inetmgr.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" gu="true" src="http://4.bp.blogspot.com/_5qeILST8nko/TAQUsxYOQfI/AAAAAAAAACE/iZoCgxTebEI/s320/inetmgr.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div align="left" class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;En la lista que aparece, debemos incluir estos tres tipos tal y como aparece en la imagen: xaml, xap, xbap.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_5qeILST8nko/TAQVS4VpaXI/AAAAAAAAACM/xz3b8v3we6k/s1600/MIME+Types.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" gu="true" src="http://3.bp.blogspot.com/_5qeILST8nko/TAQVS4VpaXI/AAAAAAAAACM/xz3b8v3we6k/s320/MIME+Types.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;Ahora, en el menú de la izquierda, vamos a Sitios, y añadimos nuestro sitio web (como sitio por defecto, como directorio virtual... según las necesidades de cada uno). &lt;br /&gt;Una vez hecho esto, nos posicionamos sobre nuestra aplicación.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_5qeILST8nko/TAQWaajTiWI/AAAAAAAAACU/Qat7LRsmmas/s1600/Default+Web+Site.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" gu="true" src="http://3.bp.blogspot.com/_5qeILST8nko/TAQWaajTiWI/AAAAAAAAACU/Qat7LRsmmas/s320/Default+Web+Site.png" /&gt;&lt;/a&gt;&lt;/div&gt;En el menú que aparece a la derecha del todo, vamos a elegir el link de "Configuración Avanzada", y en el diálogo que aparece, haremos click sobre Grupo de Aplicaciones... aparecerá al lado un botón con tres puntitos (...). Hacemos click en dicho botón y se abre otro diálogo. Seleccionamos ASP.Net V4.0 tal y como aparece en la imagen a continuación.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_5qeILST8nko/TAQXBjuh_zI/AAAAAAAAACc/mgVu-JHjamk/s1600/grupo+de+aplicaciones.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" gu="true" src="http://2.bp.blogspot.com/_5qeILST8nko/TAQXBjuh_zI/AAAAAAAAACc/mgVu-JHjamk/s320/grupo+de+aplicaciones.png" /&gt;&lt;/a&gt;&lt;/div&gt;Aquí&amp;nbsp;estaba el problema para mí. En lugar de hacer lo que acabamos de hacer dejaba el DefaultAppPool y me lanzaba un error en el servicio que tiene la función get hacia la base de datos. Ahora que tenemos nuestro grupo de aplicaciones seleccionado, vamos a configurarlo. En el panel de la izquierda, justo sobre "Sitios" está "Grupo de Aplicaciones". Aparecerá en el centro, entre otros, el que acabamos de elegir (ASP.Net V4.0). Lo abrimos y seleccionamos la versión del Net Framework correspondiente. Aceptamos y volvemos a marcarla, pero esta vez nos vamos al panel derecho, a "Configuración Avanzada".&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_5qeILST8nko/TAQYMGheRzI/AAAAAAAAACk/8MWAV5TtqzQ/s1600/Identidad+Grupo+Aplicaciones.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" gu="true" src="http://1.bp.blogspot.com/_5qeILST8nko/TAQYMGheRzI/AAAAAAAAACk/8MWAV5TtqzQ/s320/Identidad+Grupo+Aplicaciones.png" /&gt;&lt;/a&gt;&lt;/div&gt;Cambiamos el Local System por NetworkService en la cuenta integrada. Ya está! Con esto ya podemos acceder a nuestra aplicación web hecha con Silverlight y que muestre nuestros datos sin mostrar ningún error.&lt;br /&gt;&lt;br /&gt;Hay otra cosa que estaría bien tener en cuenta. Es un error frecuente fruto del despiste. Si nuestra página inicial del proyecto web no se llama Default o algo convencional, debemos añadirla en la parte de Documentos Predeterminados del IIS (estando situados sobre nuestra aplicación en el panel izquierdo veremos esa opción en el panel central)&lt;br /&gt;&lt;br /&gt;Espero que sea de ayuda.&lt;br /&gt;&lt;br /&gt;Un abrazo!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-5647296118843339593?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/5647296118843339593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2010/05/como-publicar-silverlight-4-con-datos.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/5647296118843339593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/5647296118843339593'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2010/05/como-publicar-silverlight-4-con-datos.html' title='Cómo Publicar Silverlight 4 con datos'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_5qeILST8nko/TAQQmlTS5TI/AAAAAAAAAB0/UWi6ilhFEXQ/s72-c/Solution+Explorer.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1844338521119952928.post-1720893937573946987</id><published>2010-05-31T21:32:00.000+02:00</published><updated>2010-05-31T21:32:29.090+02:00</updated><title type='text'>Mi primera publicación</title><content type='html'>&lt;strong&gt;Sed &lt;a href="mailto:tod@s"&gt;tod@s&lt;/a&gt; bienvenidos!&lt;/strong&gt;&lt;br /&gt;No sé por qué pero quise crear un blog. Muchas veces necesito información y algunos blogs me han ayudado, así que, con cosas que yo encuentre interesantes, espero poder ayudar a otros. Por el título del blog veréis que irá sobre programación. Quizá algún día haga uno de otra cosa.&lt;br /&gt;&lt;br /&gt;Un abrazo!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Welcome Everybody!&lt;/strong&gt;&lt;br /&gt;Don't really know why I created a Blog. Many times I needed information and some blogs helped me, so, I hope I'll help others with stuff that I find interesting. I guess you guessed what is this blog going to be about because of the title; yeap, programming. Maybe one day I'll start another one about something different.&lt;br /&gt;&lt;br /&gt;Regards!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1844338521119952928-1720893937573946987?l=nereolopez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nereolopez.blogspot.com/feeds/1720893937573946987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nereolopez.blogspot.com/2010/05/mi-primera-publicacion.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/1720893937573946987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1844338521119952928/posts/default/1720893937573946987'/><link rel='alternate' type='text/html' href='http://nereolopez.blogspot.com/2010/05/mi-primera-publicacion.html' title='Mi primera publicación'/><author><name>Nereo López</name><uri>http://www.blogger.com/profile/06086715264391917903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
