<?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-5848515305414254936</id><updated>2011-07-08T02:34:16.141-07:00</updated><category term='C#'/><category term='Json'/><category term='Google Maps'/><category term='Visual Studio'/><category term='jQuery'/><category term='VirtualEarth'/><category term='Gioco'/><category term='Web Services'/><category term='How-to'/><category term='Segnalazione'/><category term='Announcement'/><category term='Ajax'/><category term='ASP.NET'/><category term='Web Control'/><category term='Web Custom Control'/><title type='text'>Explobot.Net</title><subtitle type='html'>Pensieri liberi in C#, ASP.NET, Ajax e tutto quanto è programmazione</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-2583986646874005725</id><published>2009-10-02T00:05:00.000-07:00</published><updated>2009-10-02T00:08:20.750-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Segnalazione'/><title type='text'>Gladiatori Fest</title><content type='html'>Segnalo la &lt;a href=http://www.dotnetromacesta.org/EventoGladiatori.aspx target=_blank&gt;Gladiatori Fest&lt;/a&gt; a tutti i programmatori DotNet:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;"Il primo evento gratuito dell'User Group DotNetRomaCestà, sulla tecnologia .Net, in cui saranno illustrati alcune tecniche di programmazione. Le varie sessioni di questo evento, della durata di un giorno, sono di livelli diversi da sessione a sessione, permettendo a chiunque di partecipare in base alle proprie conoscenze. Nel corso dell'evento, si affronteranno argomenti avanzati come MVC ed utilizzo del database Sql Server 2008, altre sessioni riguarderanno il nuovo ambiente di Sviluppo Visual Studio 2010, come il nuovo controllo Chart della tecnologia Asp.Net 4.0 e l'utilizzo delle api di Bing.&lt;br /&gt;&lt;br /&gt;L'evento è completamente gratuito, per tanto non è disponibile un servizio di catering. Nelle vicinanze della struttura sono presenti bar e tavole calde, dove si potranno gustare buoni pasti&lt;br /&gt;&lt;br /&gt;Durante l'evento verranno estratti dei numeri assegnati ai partecipanti in fase di registrazione, che permetteranno di ricevere alcuni 'premi', in particolare alcune copie dei libri, e licenze di Kaspersky."&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-2583986646874005725?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.dotnetromacesta.org/EventoGladiatori.aspx' title='Gladiatori Fest'/><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/2583986646874005725/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=2583986646874005725' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/2583986646874005725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/2583986646874005725'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2009/10/gladiatori-fest.html' title='Gladiatori Fest'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-7374500910110171537</id><published>2009-04-25T03:08:00.000-07:00</published><updated>2009-04-29T00:52:31.999-07:00</updated><title type='text'>Are you afraid by Web Services?</title><content type='html'>&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_JxxUiJbIrBc/SfLhXyeeZCI/AAAAAAAABVg/I6p6DvgCltQ/s1600-h/ws.jpg"&gt;&lt;img style="WIDTH: 400px; HEIGHT: 361px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5328569107935552546" border="0" alt="" src="http://2.bp.blogspot.com/_JxxUiJbIrBc/SfLhXyeeZCI/AAAAAAAABVg/I6p6DvgCltQ/s400/ws.jpg" /&gt;&lt;/a&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;28.04.2009 - DOUBLE STRIKE !&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_JxxUiJbIrBc/SfgHJFoQdzI/AAAAAAAABVw/oS2v0Ee12eo/s1600-h/Foto605.jpg"&gt;&lt;img style="WIDTH: 400px; HEIGHT: 283px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5330018011704227634" border="0" alt="" src="http://3.bp.blogspot.com/_JxxUiJbIrBc/SfgHJFoQdzI/AAAAAAAABVw/oS2v0Ee12eo/s400/Foto605.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-7374500910110171537?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/7374500910110171537/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=7374500910110171537' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/7374500910110171537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/7374500910110171537'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2009/04/are-you-afraid-by-web-services.html' title='Are you afraid by Web Services?'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_JxxUiJbIrBc/SfLhXyeeZCI/AAAAAAAABVg/I6p6DvgCltQ/s72-c/ws.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-8552568041795834277</id><published>2009-02-15T06:58:00.000-08:00</published><updated>2009-02-16T00:06:07.089-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Services'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Json'/><category scheme='http://www.blogger.com/atom/ns#' term='jQuery'/><title type='text'>ASP.NET, Web Services and Json: a different approach with jQuery</title><content type='html'>&lt;div align="justify"&gt;In a &lt;a href="http://explonet.blogspot.com/2008/07/aspnet-web-services-and-json.html"&gt;previous article&lt;/a&gt; I explained how it is possible to implement in ASP.NET a client/server application based on Json web services.&lt;br /&gt;&lt;br /&gt;The client side was implemented using all the amazing possibilities offered by WCF and the Ajax support of DotNet, but this isn't the only possibility, we can consume a web service through &lt;a href="http://en.wikipedia.org/wiki/JQuery" target="_blank"&gt;jQuery &lt;/a&gt;library.&lt;br /&gt;&lt;br /&gt;Implementing the application with jQuery requires a few changes to the previous code:&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;- The ScriptManager control is no more required&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;- It's necessary to include the jQuery Javascript library (i.e. from &lt;a href="http://code.google.com/apis/ajaxlibs/" target="_blank"&gt;&lt;em&gt;AJAX Libraries API&lt;/em&gt;&lt;/a&gt; site: http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js)&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;- Some minor changes to the Javascript and HTML code of the Default.aspx page.&lt;br /&gt;&lt;br /&gt;Thanks to Alberto for some good pieces of code and useful explanations.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.vendercasa.it/download.php?file=TestJsonJquery.zip"&gt;Download TestJsonJquery.zip sample &lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-8552568041795834277?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/8552568041795834277/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=8552568041795834277' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/8552568041795834277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/8552568041795834277'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2009/02/aspnet-and-json-web-services-different.html' title='ASP.NET, Web Services and Json: a different approach with jQuery'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-5275489093881158937</id><published>2008-11-10T12:57:00.000-08:00</published><updated>2008-11-11T11:12:53.004-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How-to'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Control'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to derive a web control from another one</title><content type='html'>&lt;div align="justify"&gt;I'm developing an asp.net project containing a repeater; it is filled with a datatable and every item of the repeater contains some web controls, including a button. In response to the click on one of the buttons I have to delete a record in the table referenced by an unique ID. Many possibilities exist, usually a common solution is to use the property "CommandArgument", but because I like elegance (and using a string property to store an integer isn't elegant!), to explore new solutions and, finally, because I want to lose my VB roots and to enter the wonderful world of the C# OO programming I tried the way of creating a new web control, similar to a button, but with a new property, RecordId, useful to store an integer: the natural way is to derive the new control from a button. &lt;/div&gt;&lt;p&gt;The steps to accomplish this easy job are: &lt;/p&gt;&lt;p&gt;- Start Visual C# Express 2008 (or equivalent)&lt;/p&gt;&lt;p&gt;- Create a new Class Library project&lt;/p&gt;&lt;p&gt;- Add System.Web to references&lt;/p&gt;&lt;blockquote&gt;&lt;a href="http://3.bp.blogspot.com/_JxxUiJbIrBc/SRiocYt3vzI/AAAAAAAABP4/AhhweDmEyCg/s1600-h/web_reference.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5267144969834446642" style="MARGIN: 0px 10px 10px 0px; WIDTH: 326px; CURSOR: hand; HEIGHT: 349px" alt="" src="http://3.bp.blogspot.com/_JxxUiJbIrBc/SRiocYt3vzI/AAAAAAAABP4/AhhweDmEyCg/s400/web_reference.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;p&gt;- Rename the class with a significant name (for example ButtonExt)&lt;/p&gt;&lt;p&gt;- Define the new control in the namespace System.Web.UI.WebControls&lt;/p&gt;&lt;p&gt;- Derive the class from System.Web.UI.WebControls.Button&lt;/li&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;a href="http://4.bp.blogspot.com/_JxxUiJbIrBc/SRiobPFZF9I/AAAAAAAABPY/JRbGEvM9j5U/s1600-h/derived_button.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5267144950068877266" style="MARGIN: 0px 10px 10px 0px; WIDTH: 320px; CURSOR: hand; HEIGHT: 25px" alt="" src="http://4.bp.blogspot.com/_JxxUiJbIrBc/SRiobPFZF9I/AAAAAAAABPY/JRbGEvM9j5U/s400/derived_button.png" border="0" /&gt;&lt;/a&gt; &lt;/blockquote&gt;&lt;p&gt;- Add the RecordId property&lt;/p&gt;&lt;blockquote&gt;&lt;a href="http://3.bp.blogspot.com/_JxxUiJbIrBc/SRiobi0-oAI/AAAAAAAABPo/KJi4eH_Uh0Y/s1600-h/RecordId.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5267144955368742914" style="MARGIN: 0px 10px 10px 0px; WIDTH: 280px; CURSOR: hand; HEIGHT: 280px" alt="" src="http://3.bp.blogspot.com/_JxxUiJbIrBc/SRiobi0-oAI/AAAAAAAABPo/KJi4eH_Uh0Y/s400/RecordId.png" border="0" /&gt;&lt;/a&gt; &lt;/blockquote&gt;&lt;p&gt;- Override LoadViewState and SaveViewState for viewstate managing&lt;/p&gt;&lt;blockquote&gt;&lt;a href="http://3.bp.blogspot.com/_JxxUiJbIrBc/SRiobNSobfI/AAAAAAAABPg/Iaj9CGXSaUY/s1600-h/LoadViewState.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5267144949587537394" style="MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 166px" alt="" src="http://3.bp.blogspot.com/_JxxUiJbIrBc/SRiobNSobfI/AAAAAAAABPg/Iaj9CGXSaUY/s400/LoadViewState.png" border="0" /&gt;&lt;/a&gt; &lt;p&gt;&lt;a href="http://4.bp.blogspot.com/_JxxUiJbIrBc/SRiocO4BwyI/AAAAAAAABPw/dJQo7MfoSAk/s1600-h/SaveViewState.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5267144967192691490" style="MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 150px" alt="" src="http://4.bp.blogspot.com/_JxxUiJbIrBc/SRiocO4BwyI/AAAAAAAABPw/dJQo7MfoSAk/s400/SaveViewState.png" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;- Compile and obtain the DLL of the new control&lt;/p&gt;&lt;p&gt;And if you want to use it:&lt;/p&gt;&lt;p&gt;- Create a new asp.net project&lt;/p&gt;&lt;p&gt;- Add the DLL of the control to references&lt;/p&gt;&lt;p&gt;- Drag the DLL of the control to the General Section of the Toolbox&lt;/p&gt;&lt;p&gt;- Drag the control to the form and use it!&lt;/p&gt;&lt;p&gt;My two cents&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.vendercasa.it/download.php?file=ButtonExt.zip"&gt;Download source&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.vendercasa.it/download.php?file=DerivedCtrl.zip"&gt;Download example&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-5275489093881158937?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/5275489093881158937/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=5275489093881158937' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/5275489093881158937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/5275489093881158937'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2008/11/how-to-derive-web-control-from-another.html' title='How to derive a web control from another one'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_JxxUiJbIrBc/SRiocYt3vzI/AAAAAAAABP4/AhhweDmEyCg/s72-c/web_reference.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-8130732341964853659</id><published>2008-07-13T08:33:00.000-07:00</published><updated>2009-11-12T00:35:55.351-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Services'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Json'/><title type='text'>ASP.NET, Web Services and Json</title><content type='html'>&lt;div align="justify"&gt;&lt;a href="http://en.wikipedia.org/wiki/Web_service" target="_blank"&gt;Web services&lt;/a&gt; offer a standardized mechanism to interface remote applications written in different languages.&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;They are based on two different protocols: &lt;a href="http://en.wikipedia.org/wiki/HTTP" target="_blank"&gt;HTTP&lt;/a&gt; for the tunnelling of the information and (usually, but we will show that this isn't the only possibility) &lt;a href="http://en.wikipedia.org/wiki/XML" target="_blank"&gt;XML&lt;/a&gt; for the coding of the information.&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;The protocol also requires the server exposes some information about the format of every possible functions so the client autonomously can compose and send data requests.&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;The best scenario where you can implement web services is client-server applications over Internet.&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;The server side usually needs a web server and the service is written as a web dynamic page in PHP, ASP.NET, JSP or similar languages/environments.&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;The client side could be a stand alone application, or, better, a web application running in a browser, in this case the compatibility with the widest range of browsers/operating systems restricts the choice to 3 solutions: a Flash plug-in, a Java applet or a Javascript application (and in the future Silverlight?).&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;I don't like Java applets (I'm looking to definitely remove JVM from my notebook) and I don't know Actionscript (the language for Flash), so the only choice appears to be Javascript.&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;In my opinion Javascript offers few advantages: it is implemented in every modern browser without installing anything else, it is quite standardized and, luckily, it offers the HttpXmlResponse class to retrieve remote data through a HTTP request. But it is interpreted and it doesn't offer native functions managing XML files, so the result is that Javascript applications exchanging XML-formatted data could be very slow. &lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;Is XML the only data coding system on web services? No, it isn't: &lt;a href="http://en.wikipedia.org/wiki/Json" target="_blank"&gt;Json&lt;/a&gt; is another [great] possibility! &lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;What is Json? Json - similarly to XML - is a method to code structured data, but it reproduce a subset of the Javascript syntax of declaration and initialization of variables, arrays and objects, so it's possible to decode Json files simply with the &lt;a href="http://www.w3schools.com/jsref/jsref_eval.asp" target="_blank"&gt;eval()&lt;/a&gt; native Javascript function: easy and fast. &lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;But this is not all: Visual Studio NET 2008 offers the possibility of implement Json web services and, client-side, encapsulates the remote functions of the web services in pure-Javascript local function entry points. Great!&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Implementing Json web services in ASP.NET is very easy:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;- open Visual Web Developer 2008 Express Edition&lt;br /&gt;- create a new ASP.NET project&lt;br /&gt;- create a "Service" directory&lt;br /&gt;- inside "Service" create an "AJAX-enabled WCF Service" file named "Json.svc"&lt;br /&gt;- open "Json.cs" and modify the line "[ServiceContract(Namespace = "")]" to "[ServiceContract(Namespace = "Test")]"&lt;br /&gt;- in "Json.cs" add "using System.Collections;" the public method "GetArrayList()" (who makes and return a populated ArrayList)&lt;br /&gt;- to "Default.aspx" a ScriptManager:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;asp:ScriptManager ID="ScriptManager1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;Services&amp;gt;&lt;br /&gt;&amp;lt;asp:ServiceReference Path="~/Services/Json.svc" /&amp;gt;&lt;br /&gt;&amp;lt;/Services&amp;gt;&lt;br /&gt;&amp;lt;/asp:ScriptManager&amp;gt;&lt;br /&gt;&lt;br /&gt;- to "Default.aspx" add a label (lblTest):&lt;br /&gt;&amp;lt;asp:Label ID="lblTest" runat="server" Text=""&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&lt;br /&gt;- to "Default.aspx" add the Javascript code that connects to the remote web service:&lt;br /&gt;&lt;br /&gt;&amp;lt;script language="javascript" type="text/javascript"&amp;gt;&lt;br /&gt;var x = 0;&lt;br /&gt;function getal()&lt;br /&gt;{&lt;br /&gt;Test.Json.GetArrayList(onMethodCompleted);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function onMethodCompleted(results)&lt;br /&gt;{&lt;br /&gt;$get("lblTest").innerText = "Element " + x + ":" + results[x++];&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;- to "Default.aspx" add a button (with onclick event):&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Label ID="lblTest" runat="server" Text="PUSH"&amp;gt;&amp;lt;/asp:Label&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;br /&gt;Run and try! &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.vendercasa.it/download.php?file=TestJson.zip"&gt;Download TestJson.zip sample&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Some screenshots of the output (for Chandra):&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_JxxUiJbIrBc/SvvIBG_LPVI/AAAAAAAABWI/Ubk__Sa-EOA/s1600-h/1.png"&gt;&lt;img style="WIDTH: 118px; HEIGHT: 84px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5403132099342056786" border="0" alt="" src="http://1.bp.blogspot.com/_JxxUiJbIrBc/SvvIBG_LPVI/AAAAAAAABWI/Ubk__Sa-EOA/s200/1.png" /&gt;&lt;/a&gt; &lt;a href="http://1.bp.blogspot.com/_JxxUiJbIrBc/SvvIBW3abBI/AAAAAAAABWQ/y0hMVQYgiaI/s1600-h/2.png"&gt;&lt;img style="WIDTH: 130px; HEIGHT: 84px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5403132103604464658" border="0" alt="" src="http://1.bp.blogspot.com/_JxxUiJbIrBc/SvvIBW3abBI/AAAAAAAABWQ/y0hMVQYgiaI/s200/2.png" /&gt;&lt;/a&gt;&lt;a href="http://1.bp.blogspot.com/_JxxUiJbIrBc/SvvIBZvSrzI/AAAAAAAABWY/2ZH9qTdBL0c/s1600-h/3.png"&gt;&lt;img style="WIDTH: 164px; HEIGHT: 83px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5403132104375709490" border="0" alt="" src="http://1.bp.blogspot.com/_JxxUiJbIrBc/SvvIBZvSrzI/AAAAAAAABWY/2ZH9qTdBL0c/s200/3.png" /&gt;&lt;/a&gt;&lt;a href="http://2.bp.blogspot.com/_JxxUiJbIrBc/SvvIBgX-zrI/AAAAAAAABWg/_aO8ziHhB30/s1600-h/4.png"&gt;&lt;img style="WIDTH: 181px; HEIGHT: 83px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5403132106156986034" border="0" alt="" src="http://2.bp.blogspot.com/_JxxUiJbIrBc/SvvIBgX-zrI/AAAAAAAABWg/_aO8ziHhB30/s200/4.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-8130732341964853659?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/8130732341964853659/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=8130732341964853659' title='2 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/8130732341964853659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/8130732341964853659'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2008/07/aspnet-web-services-and-json.html' title='ASP.NET, Web Services and Json'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_JxxUiJbIrBc/SvvIBG_LPVI/AAAAAAAABWI/Ubk__Sa-EOA/s72-c/1.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-4001340528441630724</id><published>2008-05-04T01:17:00.001-07:00</published><updated>2008-12-10T22:27:29.356-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How-to'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>How to embed a resource in a DotNet DLL (and how to use it)</title><content type='html'>In my &lt;a href="http://explonet.blogspot.com/2008/03/embedvideo-web-control-to-embed-video.html"&gt;previous post&lt;/a&gt; I proposed a web custom control useful to embed videos in your web pages.&lt;br /&gt;The control is made of some server-side code written in C# and some javascript functions and one flash plug-in, both client-side.&lt;br /&gt;An interesting point is that all the necessary code is embedded in a single DLL, making the exploiting process in a ASP.NET panorama easier.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 1&lt;/strong&gt;&lt;br /&gt;In the Solution Explorer, over the file that you want to embed, right-click and choice Properties then set “”Embedded Resource” on “Build Action” :&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5196444494917253970" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_JxxUiJbIrBc/SB16vHaTu1I/AAAAAAAAAyc/IiLRF_6hn-s/s400/emebed.jpg" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 2&lt;/strong&gt;&lt;br /&gt;If the file is a web resource that you want to reference with an URL (for example a javascript file, a flash plug-in or a css file) you must open the Properties/AssemblyInfo.cs file:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_JxxUiJbIrBc/SB165naTu4I/AAAAAAAAAy0/T-vkhDNaCHg/s1600-h/embed2.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5196444675305880450" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_JxxUiJbIrBc/SB165naTu4I/AAAAAAAAAy0/T-vkhDNaCHg/s400/embed2.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;Then add the following line (&lt;em&gt;Filename.extension&lt;/em&gt; is the file to embed, &lt;em&gt;Namespace&lt;/em&gt; is the namespace of the project or of the control and &lt;em&gt;MIME_Type&lt;/em&gt; is the MIME type of the file):&lt;br /&gt;&lt;br /&gt;[&lt;span style="color:#3333ff;"&gt;assembly&lt;/span&gt;: &lt;span style="color:#33ccff;"&gt;WebResource&lt;/span&gt;(&lt;span style="color:#cc0000;"&gt;“Namespace.Filename.extension”&lt;/span&gt;, &lt;span style="color:#cc0000;"&gt;“MIME_Type“&lt;/span&gt;)]&lt;/p&gt;&lt;br /&gt;For example in &lt;a href="http://explonet.blogspot.com/2008/03/embedvideo-web-control-to-embed-video.html"&gt;my previous project&lt;/a&gt;:&lt;br /&gt;&lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_JxxUiJbIrBc/SB1653aTu5I/AAAAAAAAAy8/tX1c0V12Ock/s1600-h/embed3.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5196444679600847762" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 405px; CURSOR: hand; HEIGHT: 60px; TEXT-ALIGN: center" height="62" alt="" src="http://2.bp.blogspot.com/_JxxUiJbIrBc/SB1653aTu5I/AAAAAAAAAy8/tX1c0V12Ock/s400/embed3.gif" width="512" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;&lt;br /&gt;Using the embed file is easy, you can obtain the referencing URL with the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.getwebresourceurl.aspx" target="_blank"&gt;GetWebResourceUrl&lt;/a&gt; method:&lt;br /&gt;&lt;br /&gt;Page.ClientScript. GetWebResourceUrl (this.GetType(), Namespace.Filename.extension)&lt;/p&gt;That’s all!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-4001340528441630724?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/4001340528441630724/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=4001340528441630724' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/4001340528441630724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/4001340528441630724'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2008/05/how-to-embed-resource-in-aspnet.html' title='How to embed a resource in a DotNet DLL (and how to use it)'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_JxxUiJbIrBc/SB16vHaTu1I/AAAAAAAAAyc/IiLRF_6hn-s/s72-c/emebed.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-3085436371336858057</id><published>2008-03-09T13:14:00.000-07:00</published><updated>2008-04-24T12:49:27.616-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Custom Control'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>EmbedVideo: a web control to embed video (FLV, WFV, ...) and Flash animations</title><content type='html'>CalSoft.EmbedVideo is a web custom control for ASP.NET. It is useful to put videos or Flash animations in your web pages.&lt;br /&gt;It supports AVI, WMV and any other kind of formats supported by Windows Multimedia Player and FLV files on every Flash-enabled browser thanks to &lt;a href="http://www.osflv.com/" target="_blank"&gt;OS FLV&lt;/a&gt;, a free Flash 9 player and, finally, SWF files. The objects are embedded with a free javascript library, &lt;a href="http://www.blogger.com/_target"&gt;SWFobject&lt;/a&gt; that manages also browser differences and Flash versions.&lt;br /&gt;Some interesting points are:&lt;br /&gt;- thanks to the SWFobject it resolve &lt;a href="http://en.wikipedia.org/wiki/EOLAS" target="_blank"&gt;EOLAS problems&lt;/a&gt; (the gray frame around the control and the need for an extra click to activate it) in IE.&lt;br /&gt;- all the extra files (the two JavaScript libraries and the swf player) are embedded inside a single DLL.&lt;br /&gt;&lt;br /&gt;Installation:&lt;br /&gt;- download and unzip &lt;a href="http://www.vendercasa.it/download.php?file=EmbedVideo20.zip"&gt;EmbedVideo20.zip&lt;/a&gt; (framework 2.0) or &lt;a href="http://www.vendercasa.it/download.php?file=EmbedVideo30.zip"&gt;EmbedVideo30.zip&lt;/a&gt; (framework 3.0) or &lt;a href="http://www.vendercasa.it/download.php?file=EmbedVideo35.zip"&gt;EmbedVideo35.zip&lt;/a&gt; (framework 3.5)&lt;br /&gt;- create your web project in Visual Web Developer 2008 (or other Visual Studio products)&lt;br /&gt;- right click on the toolbox window&lt;br /&gt;- click on "Choose Items ..."&lt;br /&gt;- click "Browse..." and select the EmbedVideo.dll just unzipped.&lt;br /&gt;&lt;br /&gt;Now you are ready to use the control easily in your project: drag it in the page and set the properties (the meaning of each property is banal).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;The icon of the control:&lt;/td&gt;&lt;td&gt;&lt;img src="http://www.vendercasa.it/blog/EmbedVideo.bmp" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Note that the current version isn't compatible with ajax.net and was developed with Visual #C Express 2008.&lt;br /&gt;&lt;br /&gt;The control is released under &lt;a href="http://www.gnu.org/licenses/gpl.html"&gt;GPL license&lt;/a&gt;; please pay attention to the licenses of applications and libraries embedded consulting the respective sites.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.vendercasa.it/download.php?file=EmbedVideoSrc.zip"&gt;Download the source&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.vendercasa.it/download.php?file=EmbedVideo20.zip"&gt;Download EmbedVideo DLL for framework 2.0&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.vendercasa.it/download.php?file=EmbedVideo30.zip"&gt;Download EmbedVideo DLL for framework 3.0&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.vendercasa.it/download.php?file=EmbedVideo35.zip"&gt;Download EmbedVideo DLL for framework 3.5&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.yellowvan.it/video.aspx" target="_blank"&gt;Sample here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Some useful links:&lt;br /&gt;&lt;a title="Flash FLV player" href="http://www.osflv.com/" target="_blank"&gt;OS FLV&lt;/a&gt;&lt;br /&gt;&lt;a title="Javascript library to embed object" href="http://blog.deconcept.com/swfobject/" target="_blank"&gt;SWFObject &lt;/a&gt;&lt;br /&gt;&lt;a title="Tool to convert a video to FLV format" href="http://www.download.com/Pazera-Free-Video-To-Flash-Converter/3000-2194_4-10805935.html" target="_blank"&gt;Pazera Free Video to Flash Converter&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-3085436371336858057?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/3085436371336858057/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=3085436371336858057' title='7 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/3085436371336858057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/3085436371336858057'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2008/03/embedvideo-web-control-to-embed-video.html' title='EmbedVideo: a web control to embed video (FLV, WFV, ...) and Flash animations'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-9134079854598410893</id><published>2007-11-25T07:51:00.001-08:00</published><updated>2007-12-30T10:50:43.852-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Custom Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Google Maps'/><title type='text'>An ASP.NET web control wrapping Google Maps API</title><content type='html'>&lt;div align="justify"&gt;I'm developing the new version of my real estate web site (&lt;a href="http://www.vendercasa.it/" target="_blank"&gt;http://www.vendercasa.it/&lt;/a&gt;) and I would to enrich it with the possibility of browsing the database trough a map, so I decided of interfacing my site with Google Maps; I think the best way to obtain it is to make a web control wrapping a sub-group of &lt;a href="http://www.google.com/apis/maps/" target="_blank"&gt;Google Maps APIs&lt;/a&gt; so I realised a web control, CalSoft.GoogleMaps, that offers methods, properties and events (at the end of the post you can find a reference) useful for interfacing to the Google Maps APIs.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How to use the control in an "ASP.NET Ajax-Enabled Web Site Project"&lt;/strong&gt;:&lt;br /&gt;(note: the control works only in an Ajax project inside an update panel)&lt;br /&gt;&lt;br /&gt;1 - Insert as first line of the HTML code the DOCTYPE tag: &lt;span style="COLOR: rgb(51,0,153)"&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;2 - Insert in the &amp;lt;HEAD&amp;gt; of the HTML code: &lt;span style="COLOR: rgb(51,51,153)"&gt;&amp;lt;script src="http://maps.google.com/maps?file=api&amp;amp;amp;v=2&amp;amp;amp;key=GOOGLE_MAPS_KEY" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt; where GOOGLE_MAPS_KEY depends on the URL of your site and you can get it &lt;a href="http://www.google.com/apis/maps/signup.html" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;3 - Copy gmap.js in your web site space and insert in the &amp;lt;HEAD&amp;gt; of the HTML code: &lt;span style="COLOR: rgb(51,51,153)"&gt;&amp;lt;script src="./gmaps.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt; where "gmaps.js" is the file with the javascript client library needed by the control&lt;br /&gt;&lt;br /&gt;4 - In the body tag insert &lt;span style="COLOR: rgb(51,51,153)"&gt;onload="GLoad()" onunload="GUnload()"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;5 - Insert in your aspx page a ScriptManager and an UpdatePanel. Put outside the UpdatePanel a DIV control and fill it Id property (for example 'MYMAP') and set the dimensions of the control&lt;br /&gt;&lt;br /&gt;6 - Add the CalSoft.GoogleMaps control to the toolbox (right click over the toolbox, 'choose items...' and browse the CalSoft DLL), insert a GoogleMaps control in the UpdatePanel, fill the Control property with the Id of the control where you want the map would appear (in previous example "MYMAP"). Set the other properties according to your needs.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Problems/To do:&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;PanTo doesn't work right&lt;br /&gt;Setting "navigation map controls" properties doesn't work in runtime mode&lt;br /&gt;Test multiple controls in a single page&lt;br /&gt;Impossible to change the 'Control' property at runtime&lt;br /&gt;Implement StringBuilder where possible and useful&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Methods, properties and events reference&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Methods:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;SetCenter(Single sLat, Single sLng, int iZoom)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Set the centre of the map and the zoom factor.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;PanTo(Single sLat, Single sLng, int iMillisec)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Pan the map to the specified position in the specified time (milliseconds).(at the moment doesn't work right)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Properties:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;bool ZoomChanged&lt;br /&gt;bool MapTypeChanged&lt;br /&gt;bool CoordinatesChanged&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;These 3 read-only properties warn over a value change.&lt;br /&gt;(respectively zoom, map type and coordinates)&lt;br /&gt;&lt;br /&gt;&lt;em&gt;bool GLargeMapControl&lt;br /&gt;bool GSmallMapControl&lt;br /&gt;bool GSmallZoomControl&lt;br /&gt;bool GScaleControl&lt;br /&gt;bool GMapTypeControl&lt;br /&gt;bool GOverviewMapControl&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;They activate the visualization of the &lt;a href="http://www.google.com/apis/maps/documentation/reference.html#GControlImpl" target="_blank"&gt;standard navigation controls&lt;/a&gt; on the map.&lt;br /&gt;They are valid only at design time, changing them during runtime is useless.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;int Zoom&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;Zoom level.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Single Latitude&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;Latitude of the centre of the map.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Single Longitude&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;Longitude of the centre of the map.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;string Control&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Id of the control (usually a DIV) where the map is displayed.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;GMMapType MapType&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/apis/maps/documentation/reference.html#GMapType" target="_blank"&gt;Map type&lt;/a&gt;, the value is an enum:&lt;br /&gt;enum GMMapType { Normal, Satellite, Hybrid, Default }&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Single NELatitude&lt;br /&gt;Single NELongitude&lt;br /&gt;Single SWLatitude&lt;br /&gt;Single SWLongitude&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Latitudes and longitudes of the north-east and south-west corner of the map. They are read-only.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Events:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;OnGMClick(object sender, Single lat, Single lng)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Fired every time the user click on the map.&lt;br /&gt;Lat e lng are the coordinates (latitude and longitude) of the clicked point.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;OnGMMove(object sender, string arg)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Fired when the map change (in position, appearance or zoom).&lt;br /&gt;The properties reflect the changes of the map.(The 'arg' argument at the moment isn't implemented and give back only the string 'move').&lt;br /&gt;&lt;br /&gt;You can download the control (with all the needed files - source, compiled dll and js library) by clicking &lt;a href="http://www.vendercasa.it/download.php?file=googlemaps.zip" target="_blank"&gt;here&lt;/a&gt; or test it &lt;a href="http://www.yellowvan.it/?id=3" target="_blank"&gt;here&lt;/a&gt;. &lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-9134079854598410893?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/9134079854598410893/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=9134079854598410893' title='1 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/9134079854598410893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/9134079854598410893'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/11/aspnet-web-control-wrapping-google-maps.html' title='An ASP.NET web control wrapping Google Maps API'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-2863587764799382043</id><published>2007-11-20T23:22:00.000-08:00</published><updated>2008-12-10T22:27:29.675-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Announcement'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Visual Studio 2008 Express Released</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_JxxUiJbIrBc/R0Pfu5g4gtI/AAAAAAAAAt0/EkfPzkv_JZQ/s1600-h/vs2008.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5135193996938216146" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_JxxUiJbIrBc/R0Pfu5g4gtI/AAAAAAAAAt0/EkfPzkv_JZQ/s400/vs2008.jpg" border="0" /&gt;&lt;/a&gt; &lt;div&gt;Last Monday Microsoft released Visual Studio 2008 Express edition.&lt;br /&gt;You can download them &lt;a href="http://www.microsoft.com/express/download/" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Enjoy! &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-2863587764799382043?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.microsoft.com/express/' title='Visual Studio 2008 Express Released'/><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/2863587764799382043/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=2863587764799382043' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/2863587764799382043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/2863587764799382043'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/11/visual-studio-2008-express-released.html' title='Visual Studio 2008 Express Released'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_JxxUiJbIrBc/R0Pfu5g4gtI/AAAAAAAAAt0/EkfPzkv_JZQ/s72-c/vs2008.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-8261552410448225242</id><published>2007-11-03T09:31:00.000-07:00</published><updated>2007-11-25T10:51:38.341-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Google Maps'/><title type='text'>GMGeodecoder: a class findig places and based on Google Maps</title><content type='html'>&lt;div align="justify"&gt;In the &lt;a href="http://explonet.blogspot.com/2007/08/locationfinder-web-control-findig.html"&gt;last post&lt;/a&gt; I proposed a simple web custom control based on the Microsoft Virtual Earth APIs, now a similar class (only places, not business) based on the &lt;a href="http://www.google.com/apis/maps/documentation/services.html#Geocoding_Direct"&gt;Google Maps HTTP Geodecoding Service&lt;/a&gt; (so it's totally server side, no Ajax, no Javascript).&lt;br /&gt;&lt;br /&gt;The class &lt;strong&gt;CalSoft.GMGeodecoder&lt;/strong&gt; has only the constructor and a public method:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;public GMGeodecoder(string sGMKey)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;This is the constructor with only one parameter: the google maps API key. I'm not sure it is required, but, of course, according to the service description on the manual you must provide it (if you need a google maps API key for your site you can obtain it free &lt;a href="http://www.google.com/apis/maps/signup.html" target="_blank"&gt;here&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;public GMPlace GetPlace(string sPlace)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Method that performs a search for the location specified on sPlace and returns a GMPlace structures.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;public struct CalSoft.GMPlace&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;Single Latitude and Longitude&lt;br /&gt;&lt;/em&gt;obviously the latitude and longitude of the result place&lt;br /&gt;&lt;em&gt;&lt;br /&gt;int Accuracy&lt;/em&gt;&lt;br /&gt;an integer representing the accuracy of the result according to &lt;a href="http://www.google.com/apis/maps/documentation/reference.html#GGeoAddressAccuracy" target="_blank"&gt;that table&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;int StatusCode&lt;br /&gt;&lt;/em&gt;status code of the HTTP request&lt;br /&gt;&lt;br /&gt;&lt;em&gt;string Result&lt;br /&gt;&lt;/em&gt;the full string returned from the HTTP request&lt;br /&gt;&lt;br /&gt;You can download the class by clicking &lt;a href="http://www.vendercasa.it/download.php?file=GMGeodecoder.zip"&gt;here &lt;/a&gt;or test it &lt;a href="http://www.yellowvan.it/?id=3" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Good work!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-8261552410448225242?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.yellowvan.it/?id=3' title='GMGeodecoder: a class findig places and based on Google Maps'/><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/8261552410448225242/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=8261552410448225242' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/8261552410448225242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/8261552410448225242'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/11/gmgeodecoder-web-control-findig-places.html' title='GMGeodecoder: a class findig places and based on Google Maps'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-8712031233963540744</id><published>2007-08-18T12:08:00.000-07:00</published><updated>2007-11-25T10:52:13.881-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VirtualEarth'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Custom Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>LocationFinder: a web control findig places</title><content type='html'>&lt;div align="justify"&gt;Today a simple web custom control based on the &lt;a href="http://dev.live.com/virtualearth/sdk/" target="_blank"&gt;Microsoft Virtual Earth&lt;/a&gt; APIs and that can search for places and/or business simply passing &lt;i&gt;what&lt;/i&gt; and/or &lt;i&gt;where&lt;/i&gt;, similarly to &lt;a href="http://maps.live.com/" target="_blank"&gt;Live Local Search&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The control hasn't any property, but only a method and an event:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;void Find(string what, string where, int start, int length)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Method that performs a &lt;em&gt;what&lt;/em&gt; (business) search and/or a &lt;em&gt;where&lt;/em&gt; (location) search (at least one of these two parameters is required)., for the answer you must wait for the event.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Parameters:&lt;/em&gt;&lt;br /&gt;what: the business name, category, or other item searched for(es. "pizza")&lt;br /&gt;where: the address or place name of the area searched for (es. "New York")&lt;br /&gt;start: the beginning index of the results returned&lt;br /&gt;length: the number of results to be returned (max. 20)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;void LocationFinder_Found(object sender, VEFindResult[] results, VEPlace[] places, bool hasmore)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Event that returns a list of results and a list of places.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Parameters:&lt;/em&gt;&lt;br /&gt;results: array of VEFindResult (list of results)&lt;br /&gt;places: array of VEPlace (list of ambiguous places)&lt;br /&gt;hasmore: true if there are others results (at the moment doesn't work!)&lt;br /&gt;&lt;br /&gt;There are also two structures:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;CalSoft.VEFindResult&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Name&lt;br /&gt;Description&lt;br /&gt;Phone&lt;br /&gt;IsSponsored&lt;br /&gt;Latitude&lt;br /&gt;Longitude&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;CalSoft.VEPlace&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Name&lt;br /&gt;Latitude&lt;br /&gt;Longitude&lt;br /&gt;&lt;br /&gt;(the function of each member is intuitive)&lt;br /&gt;&lt;br /&gt;You can download the control by clicking &lt;a href="http://www.vendercasa.it/download.php?file=LocationFinder.zip"&gt;here&lt;/a&gt; or test it &lt;a href="http://www.yellowvan.it/?id=2" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;The zip contains the DLL (put it in the bin directory and add the control to the toolbox of Visual Studio) and the source (FadingImage.cs).&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;How to use the DLL in your WEB projects: &lt;/strong&gt;&lt;/div&gt;&lt;div align="justify"&gt;1 - put the DLL fille in the Bin directory of the site; &lt;/div&gt;&lt;div align="justify"&gt;2 - if you want to add the control to Visual Studio toolbox, right-click on it, click on "Choose Items ..." and browse the project to add the DLL. &lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;Note:&lt;/strong&gt; if you want to modify the source remeber to add the right references (System.Web, System.Web.Extension, System.Drawing)&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;That's all. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-8712031233963540744?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.yellowvan.it/?id=2' title='LocationFinder: a web control findig places'/><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/8712031233963540744/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=8712031233963540744' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/8712031233963540744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/8712031233963540744'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/08/locationfinder-web-control-findig.html' title='LocationFinder: a web control findig places'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-1952487650246783082</id><published>2007-08-04T10:13:00.000-07:00</published><updated>2008-12-10T22:27:29.879-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Custom Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>FadingImage: a web custom control fading between images</title><content type='html'>(note: this is my first post in English: I'm learning English, sorry for my mistakes and I will appreciate your kind corrections)&lt;br /&gt;&lt;br /&gt;For an ASP.NET project I needed to fade between images, so I decided to write a web custom control: FadingImage.&lt;br /&gt;Usage is easy: changing ImageUrl property the control fades between the previous image and the new one.&lt;br /&gt;It derives from System.Web.UI.WebControls.Image and implements IPostBackEventHandler, I added one property and two events.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-STYLE: italic"&gt;Increments&lt;/span&gt;&lt;br /&gt;% increment of opacity every 50 milliseconds (for example setting this property to 5 makes images shading in one second). If you don't want fading set this property to 0.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-STYLE: italic"&gt;onEndFading(object sender)&lt;/span&gt;&lt;br /&gt;occurs each time a fading ends.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-STYLE: italic"&gt;onClick(object sender, int t, int x, int y)&lt;/span&gt;&lt;br /&gt;occurs for every mouse click over the control, t represent the mousekey (1 = left, 2 = right), x and y the coordinates relative to the control.&lt;br /&gt;&lt;br /&gt;Compatibility:&lt;br /&gt;I tested the control with IE7, Firefox 2 and 1.5, Opera 9.21, other visitors advise me that it works with IE6, but I want to compile a complete compatibility list:&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Could you help me? Have a look at the image below:&lt;/span&gt;&lt;br /&gt;&lt;iframe border="0" marginwidth="1" marginheight="1" src="http://www.yellowvan.it/test.html" frameborder="0" width="270" scrolling="no" height="88"&gt;&amp;ampamp;amp;amp;lt;br&amp;ampamp;amp;gt;&lt;/iframe&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;What do you see (Uluru, Sydney skyline or both)? Which is your browser/version? Let me know! Thanks.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can download the control by &lt;a href="http://www.vendercasa.it/download.php?file=FadingImage.zip"&gt;clicking here&lt;/a&gt; or test it &lt;a href="http://www.yellowvan.it/?id=1" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;The zip contains the DLL (put it in the bin directory and add the control to the toolbox of Visaul Studio), the source (FadingImage.cs) and the javascript source (not needed by the program because the js code is integrated in the C# code, but I included it for an easier reading).&lt;br /&gt;&lt;br /&gt;Note: don't forget to insert the DOCTYPE tag:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_JxxUiJbIrBc/Rr2iRMqsELI/AAAAAAAAAsU/BohvExgIvAo/s1600-h/doctype.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5097408769595019442" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_JxxUiJbIrBc/Rr2iRMqsELI/AAAAAAAAAsU/BohvExgIvAo/s400/doctype.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How to use the DLL in your WEB projects:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1 - put the DLL fille in the Bin directory of the site;&lt;br /&gt;&lt;br /&gt;2 - if you want to add the control to Visual Studio toolbox, right-click on it, click on "Choose Items ..." and browse the project to add the DLL.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Note:&lt;/strong&gt; if you want to modify the source remeber to add the right references (System.Web, System.Web.Extension, System.Drawing)&lt;br /&gt;&lt;br /&gt;Good luck and let me know!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-1952487650246783082?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.yellowvan.it/?id=1' title='FadingImage: a web custom control fading between images'/><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/1952487650246783082/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=1952487650246783082' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/1952487650246783082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/1952487650246783082'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/08/fadingimage-web-custom-control-fading.html' title='FadingImage: a web custom control fading between images'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_JxxUiJbIrBc/Rr2iRMqsELI/AAAAAAAAAsU/BohvExgIvAo/s72-c/doctype.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-4320047029327119806</id><published>2007-08-02T12:36:00.000-07:00</published><updated>2008-03-01T00:47:46.547-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How-to'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Custom Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Creare un Web Custom Control - Codice completo e esempio</title><content type='html'>Finalmente il codice completo e un esempio Ajax scaricabile &lt;a href="http://www.vendercasa.it/download.php?file=WCCMenu.zip"&gt;qui&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-4320047029327119806?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/4320047029327119806/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=4320047029327119806' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/4320047029327119806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/4320047029327119806'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/08/creare-un-web-custom-control-codice.html' title='Creare un Web Custom Control - Codice completo e esempio'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-6827219650226472484</id><published>2007-07-07T00:24:00.000-07:00</published><updated>2008-12-10T22:27:30.132-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Custom Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Gioco'/><title type='text'>Memory! 2000</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_JxxUiJbIrBc/Ro-3L5oNMDI/AAAAAAAAArw/SYHNmDTtonU/s1600-h/me.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_JxxUiJbIrBc/Ro-3L5oNMDI/AAAAAAAAArw/SYHNmDTtonU/s200/me.jpg" alt="" id="BLOGGER_PHOTO_ID_5084483919400480818" border="0" /&gt;&lt;/a&gt;Ho messo on line un giochino web che sfrutta Ajax, ci potete giocare &lt;a target="_blank" href="http://www.yellowvan.it/"&gt;cliccando qui&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Le regole sono molto semplici, si tratta di scoprire le 16 carte due a due cercando di abbinare le carte uguali. Al termine del gioco ci viene indicato in quante mosse abbiamo finito il gioco.&lt;br /&gt;&lt;br /&gt;Potete scaricare qui lo user control da inserire nelle vostre pagine ASP.NET qui:&lt;br /&gt;&lt;a href="http://www.yellowvan.it/download/WebMemory.zip"&gt;Download web control Memory! 2000&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;se siete interessati alla versione Windows per giocare off-line la potete scaricare qui:&lt;br /&gt;&lt;a href="http://www.yellowvan.it/download/WinMemory.zip"&gt;Download Windows Memory! 2000&lt;/a&gt;&lt;br /&gt;(Nota: é necessario che sia istallato il &lt;a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&amp;DisplayLang=it"&gt;framework .Net 2.0&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Note tecniche&lt;/b&gt;&lt;br /&gt;I programmi sono scritti in C# utilizzando &lt;span style="font-style: italic;"&gt;Visual C# Express&lt;/span&gt; e &lt;span style="font-style: italic;"&gt;Visual Web Developer Express&lt;/span&gt; scaricabili gratuitamente dal sito Microsoft (&lt;a target="_blank" href="http://msdn.microsoft.com/vstudio/express/visualcsharp/download/"&gt;download Visual Studio 2005 Express&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Buon divertimento!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-6827219650226472484?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.yellowvan.it' title='Memory! 2000'/><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/6827219650226472484/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=6827219650226472484' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/6827219650226472484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/6827219650226472484'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/07/memory-2000.html' title='Memory! 2000'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_JxxUiJbIrBc/Ro-3L5oNMDI/AAAAAAAAArw/SYHNmDTtonU/s72-c/me.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-1367579757944036823</id><published>2007-06-02T09:38:00.001-07:00</published><updated>2008-12-10T22:27:30.891-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How-to'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Custom Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Creare un web custom control - Parte 8</title><content type='html'>&lt;span style="font-weight: bold;font-size:130%;" &gt;Integrare il controllo in un progetto ASP.NET con Ajax&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Integrare un web custom control in un progetto Ajax è molto semplice: una volta installato il &lt;a href="http://ajax.asp.net/default.aspx?tabid=47" target="_blank"&gt;supporto Ajax a Visual Web Developer 2005 Express&lt;/a&gt;, è sufficente creare un nuovo "&lt;span style="font-style: italic;"&gt;ASP.NET Ajax-Enabled web site&lt;/span&gt;":&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_JxxUiJbIrBc/RmGgOsReUAI/AAAAAAAAAFU/PIZuVxetgro/s1600-h/ajaxenabled.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_JxxUiJbIrBc/RmGgOsReUAI/AAAAAAAAAFU/PIZuVxetgro/s200/ajaxenabled.jpg" alt="" id="BLOGGER_PHOTO_ID_5071510829658951682" border="0" /&gt;&lt;/a&gt;poi nella pagina aspx, come per ogni altra applicazione Ajax, è ncessario inserire un controllo &lt;span style="font-style: italic;"&gt;ScriptManager &lt;/span&gt;e almeno un controllo &lt;span style="font-style: italic;"&gt;UpdatePanel&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_JxxUiJbIrBc/RmGhUMReUBI/AAAAAAAAAFc/NfErjnX4Yac/s1600-h/ajaxextension.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_JxxUiJbIrBc/RmGhUMReUBI/AAAAAAAAAFc/NfErjnX4Yac/s200/ajaxextension.jpg" alt="" id="BLOGGER_PHOTO_ID_5071512023659859986" border="0" /&gt;&lt;/a&gt;Per quanto riguarda il nostro web custom control non è necessario cambiare una sola riga di codice, tutto funzionerà magicamente: i programmatori della Microsoft hanno fatto proprio un bel lavoro!&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/5848515305414254936-1367579757944036823?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/1367579757944036823/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=1367579757944036823' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/1367579757944036823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/1367579757944036823'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/06/creare-un-web-custom-control-parte-8.html' title='Creare un web custom control - Parte 8'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_JxxUiJbIrBc/RmGgOsReUAI/AAAAAAAAAFU/PIZuVxetgro/s72-c/ajaxenabled.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-6591476588360611414</id><published>2007-04-21T10:18:00.001-07:00</published><updated>2008-12-10T22:27:31.529-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How-to'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Custom Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Creare un web custom control - Parte 7</title><content type='html'>&lt;span style="font-weight: bold;font-size:130%;" &gt;Integrare il controllo in un progetto ASP.NET&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Per integrare il controllo in un progetto di Visual Web Developer è necessario compilarlo per ottenere una DLL, copiarla poi nella cartella bin del progetto non è sufficiente perché significherebbe rinunciare alla possibilità di integrarlo all'interno dell'interfaccia offerta da Visual Studio, ma seguendo pochi semplici passi è possibile includerlo nel toolbox per poterlo poi utilizzare come un qualunque altro controllo:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;1 - Aggiungere il controllo al toolbox  cliccano con il tasto di destra sul toolbox stesso, selezionando poi la voce "Choose Items ..." e infine caricando la DLL appena compilata.&lt;br /&gt;&lt;br /&gt;2 - Copiare il file .js con le funzioni necessarie al funzionamento del controllo all'interno della directory del  sito e ricordarsi di referenziarlo all'interno  dell'header di ogni  pagina aspx nel quale intendiamo utilizzare il controllo:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_JxxUiJbIrBc/RipPFpl_OTI/AAAAAAAAAEM/54gw0bSKJGU/s1600-h/js.gif"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_JxxUiJbIrBc/RipPFpl_OTI/AAAAAAAAAEM/54gw0bSKJGU/s400/js.gif" alt="" id="BLOGGER_PHOTO_ID_5055940490159929650" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;E adesso è possibile iniziare ad utilizzare il controllo. Piazziamo il controllo sulla pagina e valorizziamo le proprietà principale, da codice creiamo l'array MenuItem che definisce le voci di menu e lo passiamo al controllo:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid rgb(128, 0, 0); padding: 12px; font-family: Courier New; margin-left: 32px; margin-right: 32px; background-color: rgb(255, 255, 255); text-align: left;"&gt;#using ExploWCC;&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;if (!IsPostBack)&lt;br /&gt;{&lt;br /&gt;MenuItem[] yv = new MenuItem[4];&lt;br /&gt;&lt;br /&gt;yv[0].Title = "Menu numero 1";&lt;br /&gt;yv[0].ToolTip = "Questo è il tooltip 1";&lt;br /&gt;&lt;br /&gt;yv[1].Title = "Menu numero 2";&lt;br /&gt;yv[1].ToolTip = "Questo è il tooltip 2";&lt;br /&gt;&lt;br /&gt;yv[2].Title = "Menu numero 3";&lt;br /&gt;yv[2].ToolTip = "Questo è il tooltip 3";&lt;br /&gt;&lt;br /&gt;yv[3].Title = "Menu numero 4";&lt;br /&gt;yv[3].ToolTip = "Questo è il tooltip 4";&lt;br /&gt;&lt;br /&gt;MenuLeft.MenuItems = yv;&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;Poi è necessario gestire l'evento aggiungendo il seguente codice:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid rgb(128, 0, 0); padding: 12px; font-family: Courier New; margin-left: 32px; margin-right: 32px; background-color: rgb(255, 255, 255); text-align: left;"&gt;protected void MenuLeft_MenuChange(object sender, int e)&lt;br /&gt;{&lt;br /&gt;    MenuLeft.Selected = e;&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;e valorizzare l'attributo OnMenuChange nel tag del controllo:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid rgb(128, 0, 0); padding: 12px; font-family: Courier New; margin-left: 32px; margin-right: 32px; background-color: rgb(255, 255, 255); text-align: left;"&gt;OnMenuChange="MenuLeft_MenuChange"&lt;/div&gt;&lt;br /&gt;Fine, è tutto (o quasi, è evidente che per arricchire il controllo è necessario definire stili, aggiungere immagini ... ma questo è lavoro per il webdesigner. Nella prossima, ed ultima, puntata integrerò il nostro controllo in un progetto Ajax e infine renderò possibile per lo scaricamento il progetto completo sia del controllo che del sito che lo utilizza.&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/5848515305414254936-6591476588360611414?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/6591476588360611414/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=6591476588360611414' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/6591476588360611414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/6591476588360611414'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/04/creare-un-web-custom-control-parte-7.html' title='Creare un web custom control - Parte 7'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_JxxUiJbIrBc/RipPFpl_OTI/AAAAAAAAAEM/54gw0bSKJGU/s72-c/js.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-7635289903682665246</id><published>2007-04-20T12:33:00.001-07:00</published><updated>2008-03-01T00:46:47.225-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How-to'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Custom Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Creare un web custom control - Parte 6</title><content type='html'>&lt;span style="font-weight: bold;font-size:130%;" &gt;Eventi&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Per completare il controllo è necessario dotarlo della capacità, in corrispondenza del click su una voce di menu, di generare un evento lato client che scateni l'esecuzione di codice lato server.&lt;br /&gt;&lt;br /&gt;La sequenza di operazioni che porta al raise di un evento all'interno dell'architettura ASP.NET è la seguente:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;javascript, in genere in risposta ad un evento DHTML, invoca la funzione &lt;span style="font-style: italic;"&gt;__doPostBack&lt;/span&gt; con due argomenti: &lt;span style="font-style: italic;"&gt;eventTarget &lt;/span&gt;con il nome del controllo che ha generato l'evento e &lt;span style="font-style: italic;"&gt;eventArgument &lt;/span&gt;come variabile dove inserire dei parametri aggiuntivi.&lt;/li&gt;&lt;li&gt;a questo punto l'esecuzione del comando è presa in carico dalle librerie javascript di ASP.NET che provvedono a passare i dati al server tramite un normale postback con ricaricamento della pagina in un tradizionale progetto ASP.NET o tramite la classe &lt;span style="font-style: italic;"&gt;XMLHttpRequest &lt;/span&gt;&lt;span&gt;nei progetti che ricorrono ad Ajax.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;il server elabora la richiesta eseguendo il codice necessario compreso il codice corrispondente all'evento e risponde al client rinviando i dati in formato XML oppure HTML a seconda che si stia lavorando in Ajax o  meno.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;In un progetto Ajax è ancora la libreria ASP.NET client ad elaborare la risposta e ad aggiornare l'aspetto della pagina, in un progetto tradizionale è il browser che esegue il rendering della pagina.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;Nel nostro progetto la funzione javascript che si occupa di eseguire un &lt;span style="font-style: italic;"&gt;__doPostBack&lt;/span&gt; è &lt;span style="font-style: italic;"&gt;YVChgBkgMnu &lt;/span&gt;come è possibile verificare nella libreria js riportata nel &lt;a style="font-style: italic;" target="_blank" href="http://explonet.blogspot.com/2007/04/creare-un-web-custom-control-2-html-e.html"&gt;secondo articolo&lt;/a&gt; dove si può notare che come secondo argomento della funzione è passato l'indice (0 ... n-1) della voce di menu cliccata.&lt;br /&gt;&lt;br /&gt;Decidiamo di chiamare il nostro evento con il nome di &lt;span style="font-style: italic;"&gt;MenuChangeHandler&lt;/span&gt;, nel codice C# è necessario quindi dichiararlo:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid rgb(128, 0, 0); padding: 12px; font-family: Courier New; margin-left: 32px; margin-right: 32px; background-color: rgb(255, 255, 255); text-align: left;"&gt;public delegate void MenuChangeHandler(object sender, int e);&lt;/div&gt;&lt;br /&gt;All'interno della classe dichiariamo il delegate &lt;span style="font-style: italic;"&gt;MenuChange&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid rgb(128, 0, 0); padding: 12px; font-family: Courier New; margin-left: 32px; margin-right: 32px; background-color: rgb(255, 255, 255); text-align: left;"&gt;public event MenuChangeHandler MenuChange;&lt;/div&gt;&lt;br /&gt;E inseriamo il codice di risposta all'evento:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid rgb(128, 0, 0); padding: 12px; font-family: Courier New; margin-left: 32px; margin-right: 32px; background-color: rgb(255, 255, 255); text-align: left;"&gt;public void RaisePostBackEvent(string &lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (MenuChange != null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MenuChange(this, Convert.ToInt16(eventArgument));&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;La nostra nuova classe Menu.cs può essere visualizzata cliccando &lt;a href="http://www.vendercasa.it/blog/menu6.txt" target=_blank&gt;qui&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-7635289903682665246?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/7635289903682665246/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=7635289903682665246' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/7635289903682665246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/7635289903682665246'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/04/web-custom-control-parte-6.html' title='Creare un web custom control - Parte 6'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-680132521455727994</id><published>2007-04-09T08:36:00.001-07:00</published><updated>2008-12-10T22:27:31.688-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How-to'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Custom Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Creare un web custom control - Parte 5</title><content type='html'>&lt;span style="font-weight: bold;font-size:130%;" &gt;Il metodo Render&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Il metodo Render si occupa di generare il codice HTML che rappresenta il controllo in base al valore delle delle proprietà e ad altri parametri come per esempio lo &lt;span style="font-style: italic;"&gt;user agent&lt;/span&gt;.&lt;br /&gt;Nel nostro caso si tratta di creare un nuovo metodo Render che sovrascriva quello standard del controllo e che si occupi di generare le sequenze di &amp;lt;div&amp;gt;, &amp;lt;table&amp;gt; e &amp;lt;img&amp;gt; che costituiscono il menu secondo la struttura indicata nel &lt;a style="font-style: italic;" href="http://explonet.blogspot.com/2007/04/creare-un-web-custom-control-2-html-e.html"&gt;secondo articolo&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Il metodo Render non restituisce nessun valore e accetta in ingresso un parametro di tipo &lt;span style="font-style: italic;"&gt;HtmlTextWriter.&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;Il listato del metodo Render è scaricabile &lt;a href="http://www.vendercasa.it/blog/render.txt" target="_blank"&gt;qui&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Per gestire i differenti meccanismi con i quali i principali browser gestiscono la trasparenza è stata introdotta la funzione opacity così definita:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid rgb(128, 0, 0); padding: 12px; font-family: Courier New; margin-left: 32px; margin-right: 32px; background-color: rgb(255, 255, 255); text-align: left;"&gt;private string opacity(int x)&lt;br /&gt;{&lt;br /&gt;    if (Page.Request.UserAgent.Contains("MSIE"))&lt;br /&gt;  {&lt;br /&gt;    return "filter:alpha(opacity=" + x.ToString() +");";&lt;br /&gt;  }&lt;br /&gt;  else&lt;br /&gt;  {&lt;br /&gt;    string op = ((x + 1000).ToString()).Substring(1);&lt;br /&gt;    return "opacity:" + op.Substring(0, 1) + "." + op.Substring(1) + ";";&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;Nota&lt;/span&gt;: il metodo Render richiama anche dei metodi privati della classe il cui codice sarà presente nel download finale del progetto, ma che adesso è preferibile trascurare per semplicità. Inoltre per il corretto funzionamento di tutto il nuovo codice aggiunto è necessario includere i namespace &lt;span style="font-style: italic;"&gt;System &lt;/span&gt;e &lt;span style="font-style: italic;"&gt;System.Web.UI&lt;/span&gt; aggiungendo in testa al listato della classe le righe:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid rgb(128, 0, 0); padding: 12px; font-family: Courier New; margin-left: 32px; margin-right: 32px; background-color: rgb(255, 255, 255); text-align: left;"&gt;using System;&lt;br /&gt;using System.Web.UI;&lt;/div&gt;&lt;br /&gt;oltre ad aggiungere un riferimento agli assembly &lt;span style="font-style: italic;"&gt;System.Drawing&lt;/span&gt; e &lt;span style="font-style: italic;"&gt;System.Web.Extensions&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_JxxUiJbIrBc/RiEyPDzxmFI/AAAAAAAAADs/G0Hg1W5yS-o/s1600-h/ref.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_JxxUiJbIrBc/RiEyPDzxmFI/AAAAAAAAADs/G0Hg1W5yS-o/s320/ref.gif" alt="" id="BLOGGER_PHOTO_ID_5053375491188299858" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-680132521455727994?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/680132521455727994/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=680132521455727994' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/680132521455727994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/680132521455727994'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/04/creare-un-web-custom-control-parte-5.html' title='Creare un web custom control - Parte 5'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_JxxUiJbIrBc/RiEyPDzxmFI/AAAAAAAAADs/G0Hg1W5yS-o/s72-c/ref.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-2909250466697556052</id><published>2007-04-09T08:35:00.000-07:00</published><updated>2008-03-01T00:46:16.160-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How-to'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Custom Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Creare un web custom control - Parte 4</title><content type='html'>&lt;span style="font-weight: bold;font-size:130%;" &gt;Le proprietà di default e custom&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Come ogni controllo, anche il nostro avrà una serie di proprietà, alcune ereditate dalla classe WebControl da cui è derivato, alcune create appositamente. Le proprietà entreranno in gioco in fase di rendering del controllo caratterizzando il codice HTML.&lt;br /&gt;&lt;br /&gt;Le proprietà ereditate che gestiremo sono:&lt;br /&gt;&lt;br /&gt;ID&lt;br /&gt;Visible&lt;br /&gt;Width&lt;br /&gt;BorderStyle&lt;br /&gt;BorderWidth&lt;br /&gt;BackColor&lt;br /&gt;BorderColor&lt;br /&gt;&lt;br /&gt;mentre le nuove proprietà introdotte sono:&lt;br /&gt;&lt;br /&gt;Opacity (int)&lt;br /&gt;CssClassMenuOver (string)&lt;br /&gt;CssClassMenu (string)&lt;br /&gt;CssClassToolTip (string)&lt;br /&gt;Selected (int)&lt;br /&gt;Top (Unit)&lt;br /&gt;Left (Unit)&lt;br /&gt;ZIndex (int)&lt;br /&gt;MenuItems (array di elementi di tipo MenuItem)&lt;br /&gt;&lt;br /&gt;con MenuItem definito in questo modo:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid rgb(128, 0, 0); padding: 12px; margin-left: 32px; margin-right: 32px; background-color: rgb(255, 255, 255); text-align: justify;"&gt;public struct MenuItem&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public string Title;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public string ToolTip;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public bool Hidden;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public string Style;&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;e definisce le caratteristiche di una singola voce di menu.&lt;br /&gt;&lt;br /&gt;Quindi al codice della classe è necessario aggiungere le seguenti righe di codice:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid rgb(128, 0, 0); padding: 12px; margin-left: 32px; margin-right: 32px; background-color: rgb(255, 255, 255); text-align: justify;"&gt;#region Properties&lt;br /&gt;private int _opacity = 20;&lt;br /&gt;public int Opacity&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_opacity = value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (_opacity &lt; 0)&lt;br /&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;_opacity = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (_opacity &gt; 100)&lt;br /&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;_opacity = 100;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return _opacity;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private MenuItem[] _menuitems;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public MenuItem[] MenuItems&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_menuitems = value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return (_menuitems);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private string _cssclassmenuover;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public string CssClassMenuOver&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_cssclassmenuover = value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return _cssclassmenuover;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private string _cssclassmenu;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public string CssClassMenu&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_cssclassmenu = value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return _cssclassmenu;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private string _cssclasstooltip;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public string CssClassToolTip&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_cssclasstooltip = value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return _cssclasstooltip;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private int _selected;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public int Selected&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_selected = value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return _selected;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private Unit _top = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public Unit Top&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_top = value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return _top;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private Unit _left = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public Unit Left&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_left = value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return _left;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private int _zindex = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public int ZIndex&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_zindex = value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return _zindex;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;#endregion&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Nota&lt;/b&gt;: siccome abbiamo definito delle proprietà e delle variabili di tipo Unit è necessario includere anche il namespace System.Web.UI.WebControls aggiungendo in testa del file della classe la seguente riga di codice:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid rgb(128, 0, 0); padding: 12px; margin-left: 32px; margin-right: 32px; background-color: rgb(255, 255, 255); text-align: justify;"&gt;using System.Web.UI.WebControls;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-2909250466697556052?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/2909250466697556052/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=2909250466697556052' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/2909250466697556052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/2909250466697556052'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/04/creare-un-web-custom-control-parte-4.html' title='Creare un web custom control - Parte 4'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-3669350508715187148</id><published>2007-04-09T08:16:00.000-07:00</published><updated>2008-12-10T22:27:33.019-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How-to'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Custom Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Creare un web custom control - Parte 3</title><content type='html'>&lt;span style="font-weight: bold;font-size:130%;" &gt;La classe Menu.cs&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Finalmente è arrivato il momento di mettere mano al codice C#, quindi avviamo il Visual C# e creiamo un nuovo progetto di tipo "&lt;span style="font-style: italic;"&gt;Class Library&lt;/span&gt;" e gli diamo il nome "&lt;span style="font-style: italic;"&gt;ExploWCC&lt;/span&gt;" (&lt;span style="font-style: italic;"&gt;Explobot Web Custom Controls&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_JxxUiJbIrBc/Rhpbu7_OV9I/AAAAAAAAADM/C12Rl_FXugA/s1600-h/class.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_JxxUiJbIrBc/Rhpbu7_OV9I/AAAAAAAAADM/C12Rl_FXugA/s320/class.gif" alt="" id="BLOGGER_PHOTO_ID_5051450793984415698" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Visual C#&lt;/span&gt; ci crea la struttura di progetto, compreso la classe &lt;span style="font-style: italic;"&gt;Class1.cs&lt;/span&gt; che rinominiamo in &lt;span style="font-style: italic;"&gt;Menu.cs&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_JxxUiJbIrBc/Rhpb-7_OV_I/AAAAAAAAADc/d3bpusd5VgE/s1600-h/menu.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_JxxUiJbIrBc/Rhpb-7_OV_I/AAAAAAAAADc/d3bpusd5VgE/s320/menu.gif" alt="" id="BLOGGER_PHOTO_ID_5051451068862322674" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;La nostra nuova classe, siccome vuole essere un &lt;span style="font-style: italic;"&gt;web control&lt;/span&gt;, eredita da &lt;span style="font-style: italic;"&gt;System.Web.UI.WebControls.WebControl&lt;/span&gt;, assumendo quindi il seguente aspetto:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid rgb(128, 0, 0); padding: 12px; width: 400px; margin-left: 32px; margin-right: 32px; background-color: rgb(255, 255, 255); text-align: justify;"&gt;namespace ExploWCC&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public class Menu : System.Web.UI.WebControls.WebControl&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;Se proviamo a compilare questa semplicissima classe ci vengono segnalati una serie di errori che ci stanno ad indicare la necessità di inserire un riferimento all'&lt;span style="font-style: italic;"&gt;assembly System.Web&lt;/span&gt; seguendo dei semplici passaggi:&lt;ul&gt;&lt;li&gt;click con il tasto di destra sul  nome della libreria (&lt;span style="font-style: italic;"&gt;ExploWCC&lt;/span&gt;) nel &lt;span style="font-style: italic;"&gt;Solution Explorer&lt;/span&gt;&lt;/li&gt;&lt;li&gt;nel menu che compare selezionare la voce "&lt;span style="font-style: italic;"&gt;Add Reference ...&lt;/span&gt;"&lt;/li&gt;&lt;li&gt;nella &lt;span style="font-style: italic;"&gt;label &lt;/span&gt;".NET" del pannello che compare fare doppio click su &lt;span style="font-style: italic;"&gt;System.Web&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_JxxUiJbIrBc/RhpcF7_OWAI/AAAAAAAAADk/BUfgZVPuG7k/s1600-h/sistemweb.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_JxxUiJbIrBc/RhpcF7_OWAI/AAAAAAAAADk/BUfgZVPuG7k/s320/sistemweb.gif" alt="" id="BLOGGER_PHOTO_ID_5051451189121406978" border="0" /&gt;&lt;/a&gt;A questo punto la compilazione può avvenire senza errori, quindi nel &lt;span style="font-style: italic;"&gt;Solution Explorer&lt;/span&gt;, nella cartella &lt;span style="font-style: italic;"&gt;References &lt;/span&gt;compare anche &lt;span style="font-style: italic;"&gt;System.Web&lt;/span&gt; (nel mio caso sono presenti anche la &lt;span style="font-style: italic;"&gt;System.Data&lt;/span&gt; e la &lt;span style="font-style: italic;"&gt;SystemXml&lt;/span&gt; che ho rimosso perché al momento non mi servono):&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_JxxUiJbIrBc/Rhpb17_OV-I/AAAAAAAAADU/USKhQYFgKXM/s1600-h/se.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_JxxUiJbIrBc/Rhpb17_OV-I/AAAAAAAAADU/USKhQYFgKXM/s320/se.gif" alt="" id="BLOGGER_PHOTO_ID_5051450914243500002" border="0" /&gt;&lt;/a&gt;&lt;br /&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/5848515305414254936-3669350508715187148?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/3669350508715187148/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=3669350508715187148' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/3669350508715187148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/3669350508715187148'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/04/creare-un-web-custom-control-parte-3.html' title='Creare un web custom control - Parte 3'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_JxxUiJbIrBc/Rhpbu7_OV9I/AAAAAAAAADM/C12Rl_FXugA/s72-c/class.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-5182090056330916077</id><published>2007-04-05T08:49:00.000-07:00</published><updated>2008-03-01T00:45:37.158-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How-to'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Custom Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Creare un web custom control - Parte 2</title><content type='html'>&lt;b&gt;&lt;big&gt;HTML e Javascript&lt;/big&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Il controllo che vogliamo realizzare è un menu verticale in cui l'elemento  selezionato viene evidenziato con due righe orizzontali sopra e sotto con uno sfondo di colore diverso con la prerogativa di poter settare il coefficiente di trasparenza; inoltre un'altra peculiarità è quella di poter mostrare dei baloon in corrispondenza dell'elemento sul quale si posiziona il mouse.&lt;br /&gt;&lt;br /&gt;Il menu è stato ottenuto, a differenza dei menu CSS più recenti, non con i tag &amp;lt;UL&amp;gt; e &amp;lt;LI&amp;gt; (&lt;a target="_blank" href="http://www.constile.org/template/menu_verticali/"&gt;come spiegato qui per esempio&lt;/a&gt;), ma nel più tradizionale metodo con una serie di &amp;lt;DIV&amp;gt;, uno per ogni voce di menu oltre a uno per lo sfondo dell'elemento selezionato, uno per le sottolineature superiori ed inferiori sempre dell'elemento selezionato, uno per il contenuto del baloon e uno per l'ombra del baloon.&lt;br /&gt;&lt;/div&gt;Il codice HTML di cui si compone un menu è quindi di questo tipo:&lt;br /&gt;&lt;br /&gt;&amp;lt;DIV id=NomeMenu ... &amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;DIV ... &amp;gt;Menu 1&amp;lt;/DIV&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;DIV ... &amp;gt;Menu 2&amp;lt;/DIV&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;DIV id=NomeMenu_bkg ...&amp;gt;&amp;lt;/DIV&amp;gt;    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;DIV id=NomeMenu_border ...&amp;gt;&amp;lt;/DIV&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;DIV id=NomeMenu_baloon ...&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;DIV id=NomeMenu_ombra ...&amp;gt;&amp;lt;/DIV&amp;gt;&lt;br /&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;lt;TABLE&amp;gt;&lt;br /&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;lt;TR&amp;gt;&lt;br /&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;lt;TD class=tooltip id=NomeMenu_text&amp;gt;&amp;amp;nbsp;&amp;lt;/TD&amp;gt;&lt;br /&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;lt;/TR&amp;gt;&lt;br /&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;lt;/TABLE&amp;gt;&lt;br /&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;lt;IMG id=NomeMenu_freccia ... &amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/DIV&amp;gt;&lt;br /&gt;&amp;lt;/DIV&amp;gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Evidentemente, non facendo ricorso ad automatismi CSS, a corredo del controllo c'è una libreria di funzioni javascript che gestisce l'interazione utente&amp;lt;-&amp;gt;browser&amp;lt;-&amp;gt;server; &lt;a href="javascript:void(0);" onclick="if(document.getElementById('js_code').style.display=='block'){document.getElementById('js_code').style.display='none';}else {document.getElementById('js_code').style.display='block';}return(false);"&gt;clicca qui&lt;/a&gt; per visualizzare la libreria, oppure &lt;a target="_blank" href="http://www.vendercasa.it/go?go=http://www.vendercasa.it/blog/YVControls.js.7z"&gt;qui per scaricarla&lt;/a&gt;.&lt;br /&gt;&lt;/div&gt;&lt;div id="js_code" style="border: 1px solid rgb(128, 0, 0); padding: 12px; margin-left: 32px; margin-right: 32px; display: none; background-color: rgb(255, 255, 240); text-align: justify;"&gt;// Raccolta di variabili e funzioni javascript necessarie al menu&lt;br /&gt;&lt;br /&gt;var curdiv;&lt;br /&gt;var curmenuctrl;&lt;br /&gt;var curmenuitem;&lt;br /&gt;var curclass;&lt;br /&gt;&lt;br /&gt;// Attiva l'elemento di menu 'num' del controllo di nome 'cntrl'&lt;br /&gt;function YVSetMenu(cntrl,num)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var m = document.getElementById(cntrl).getElementsByTagName(&amp;quot;div&amp;quot;)[num];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var y = m.offsetTop;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var h = m.clientHeight;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bkg = document.getElementById(cntrl + &amp;quot;_bkg&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;brd = document.getElementById(cntrl + &amp;quot;_border&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bkg.style.height = h;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bkg.style.top = y;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;brd.style.height = h;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;brd.style.top = y;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bkg.style.display = &amp;quot;block&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;brd.style.display = &amp;quot;block&amp;quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Seleziona l'elemento dimenu cliccato e fa una chiamata per generar l'evento lato server&lt;br /&gt;function YVChgBkgMnu()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;YVSetMenu(curmenuctrl, curmenuitem);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;__doPostBack(curmenuctrl, curmenuitem);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Mostra il tooltip i corrispondenza dell'elemento di &lt;br /&gt;// menu sul quale si trova il puntatore del mouse&lt;br /&gt;function YVShowTooltip(cntrl, mnu, txt, clss)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(cntrl!=undefined)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&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;curdiv = document.getElementById(cntrl).getElementsByTagName(&amp;quot;div&amp;quot;)[mnu];&lt;br /&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;curmenuitem = mnu;&lt;br /&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;curmenuctrl = cntrl;&lt;br /&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;curclass = clss;&lt;br /&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;document.body.style.cursor = &amp;quot;hand&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&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;posy = curdiv.offsetTop + (curdiv.offsetHeight / 2);&lt;br /&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;curdiv.className = curclass;&lt;br /&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;br /&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;if(txt!=&amp;quot;&amp;quot;)&lt;br /&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;br /&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;document.getElementById(curmenuctrl + &amp;quot;_baloon&amp;quot;).style.top = posy - 77;&lt;br /&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;document.getElementById(curmenuctrl + &amp;quot;_baloon&amp;quot;).style.display = 'block';&lt;br /&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;document.getElementById(curmenuctrl + &amp;quot;_text&amp;quot;).innerHTML= unescape(txt);&lt;br /&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;br /&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;else&lt;br /&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;br /&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;document.getElementById(curmenuctrl + &amp;quot;_baloon&amp;quot;).style.display = 'none';&lt;br /&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;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;br /&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;document.getElementById(curmenuctrl + &amp;quot;_baloon&amp;quot;).style.display = 'block';&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Nasconde il tooltip&lt;br /&gt;function YVHideTooltip(clss)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;document.body.style.cursor = &amp;quot;default&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;curdiv.className = clss;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;document.getElementById(curmenuctrl + '_baloon').style.display = 'none';&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Altre funzioni javascript sono cablate all'interno del codice HTML nel momento in cui viene generato dall'evento Render del controllo, ma questo verrà visto in una prossima lezione.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-5182090056330916077?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/5182090056330916077/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=5182090056330916077' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/5182090056330916077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/5182090056330916077'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/04/creare-un-web-custom-control-2-html-e.html' title='Creare un web custom control - Parte 2'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-1178858158797320709</id><published>2007-03-31T02:06:00.001-07:00</published><updated>2008-03-01T00:45:16.227-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How-to'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Custom Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Creare un web custom control - Parte 1</title><content type='html'>&lt;b&gt;&lt;big&gt;Introduzione&lt;/big&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="clsBlurb"&gt;ASP.NET permette l'utilizzo di controlli web personalizzati di 2 tipi differenti:&lt;br /&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;User control&lt;/li&gt;&lt;li&gt;Custom control&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="clsBlurb"&gt;I &lt;span style="font-style: italic;"&gt;web user control&lt;/span&gt; sono più semplici da realizzare e si ottengono assemblando controlli già esistenti, mentre con i &lt;/span&gt;&lt;span class="clsBlurb"&gt;&lt;span style="font-style: italic;"&gt;web custom control&lt;/span&gt; il programmatore si deve occupare anche della generazione del codice HTML associato e quindi sono più complessi da realizzare, ma anche più versatili e permettono di ottenere risultati difficilmente ottenibili con i &lt;span style="font-style: italic;"&gt;web user control&lt;/span&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="clsBlurb"&gt;In questa serie di articoli mi occuperò appunto dei &lt;span style="font-style: italic;"&gt;web custom control&lt;/span&gt;, illustrerò come realizzare un menu ampiamente configurabile e con qualche effetto originale (come per esempio i &lt;span style="font-style: italic;"&gt;baloon&lt;/span&gt; per le voci del menu o l'effetto trasparenza) questo mi permetterà di illustrare alcuni punti interessanti come la possibilità di generare un evento lato server utilizzando javascript, come generare codice HTML differente a seconda dello &lt;span style="font-style: italic;"&gt;user agent&lt;/span&gt;, come utilizzare le proprietà standard dei controlli web standard (&lt;span style="font-style: italic;"&gt;System.Web.UI.WebControls.WebControl&lt;/span&gt;) e come crearne di personalizzate e integrate con le funzionalità di &lt;span style="font-style: italic;"&gt;intellisense&lt;/span&gt; e infine come integrarle in una pagine aspx illustrando come continui a funzionare egregiamente anche in un progetto ASP.NET con supporto Ajax.&lt;br /&gt;&lt;br /&gt;Per poter seguire l'articolo e utilizzare il codice dell'esempio che fornirò è necessario aver installato almeno &lt;span style="font-style: italic;"&gt;Visual Studio C# 2005 Express&lt;/span&gt; per realizzare il controllo, &lt;span style="font-style: italic;"&gt;Visual Web Developer 2005 Express&lt;/span&gt; con &lt;span style="font-style: italic;"&gt;estensioni Ajax&lt;/span&gt; per testarlo.&lt;br /&gt;&lt;br /&gt;Se volete dare un'occhiata al risultato finale andate sul mio sito &lt;a href="http://www.yellowvan.it" target="_blank"&gt;The Yellow Van&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-1178858158797320709?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/1178858158797320709/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=1178858158797320709' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/1178858158797320709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/1178858158797320709'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/03/creare-un-web-custom-control-1.html' title='Creare un web custom control - Parte 1'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5848515305414254936.post-7050329903315425824</id><published>2007-03-25T11:05:00.000-07:00</published><updated>2008-03-01T00:44:56.298-08:00</updated><title type='text'>Primo post!</title><content type='html'>&lt;div align="justify"&gt;Finalmente ho vinto la mia battaglia con la personalizzazione dei template di Blogger, mi restano solo dei problemi con Opera (non si posizionano correttamente un paio di DIV forse per colpa dell'attributo float degli style), io ho testato con IE7, con Firefox 2.0 e con K-Meleon, se qualcuno ha problemi con altri browser me lo segnali.&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;Arriviamo allora al sodo: cosa conterrà questo sito? Tanto codice C# soprattutto (ma non solo) per applicazioni ASP.NET, con un occhio particolare alla sperimentazione in Ajax e alla realizzazione di web custom control. Gli strumenti di cui è necessario disporre sono tutti liberamente scaricabili e si tratta del &lt;em&gt;Framework 2.0&lt;/em&gt;, delle edizioni 2005 Express di &lt;em&gt;Visual C#&lt;/em&gt; e di &lt;em&gt;Visual Web Developer&lt;/em&gt; con le &lt;em&gt;estensioni Ajax&lt;/em&gt;. Per le stampe, se necessario, ricorrerò al &lt;em&gt;Reporting Add-In&lt;/em&gt; di Microsoft e a &lt;em&gt;Paint.NET&lt;/em&gt; per gestire la grafica.&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;Concludo con una massima di &lt;a href="http://it.wikipedia.org/wiki/Antoine_de_Saint-Exup%C3%A9ry"&gt;Antoine De Saint Exupéry&lt;/a&gt; che ho sempre avuto come riferimento nella mia attività di programmatore:&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="center"&gt;&lt;em&gt;"La perfezione si attinge non quando non c'é più niente da aggiungere, ma quando non c'é più niente da togliere"&lt;/em&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5848515305414254936-7050329903315425824?l=explonet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://explonet.blogspot.com/feeds/7050329903315425824/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5848515305414254936&amp;postID=7050329903315425824' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/7050329903315425824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5848515305414254936/posts/default/7050329903315425824'/><link rel='alternate' type='text/html' href='http://explonet.blogspot.com/2007/03/primo-post.html' title='Primo post!'/><author><name>Explobot</name><uri>http://www.blogger.com/profile/14357524085622946370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_JxxUiJbIrBc/TJoJLS0yg6I/AAAAAAAABW0/4DosgdUns1c/S220/piedi.jpg'/></author><thr:total>0</thr:total></entry></feed>
