<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog de Nico-pyright(c) &#187; Ajax</title>
	<atom:link href="https://blog.developpez.com/nico-pyright/pcategory/ajax/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.developpez.com/nico-pyright</link>
	<description></description>
	<lastBuildDate>Mon, 08 Apr 2013 09:26:35 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>MVP Visual C# pour 2012</title>
		<link>https://blog.developpez.com/nico-pyright/p10627/c/mvp_visual_c_pour_2012</link>
		<comments>https://blog.developpez.com/nico-pyright/p10627/c/mvp_visual_c_pour_2012#comments</comments>
		<pubDate>Tue, 03 Jan 2012 20:55:19 +0000</pubDate>
		<dc:creator><![CDATA[nico-pyright(c)]]></dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Après avoir été nominé MVP Visual C++ en 2007, puis MVP ASP.NET en 2010, me voilà désormais MVP Visual C# pour 2012. Je reconnais que ce blog est de moins en moins mis à jour mais je vais essayer de me rattraper Merci encore à Microsoft de me renouveler sa confiance. J&#8217;en profite au passage pour vous souhaitez à tous une bonne année, pleine de C# et de .NET.]]></description>
				<content:encoded><![CDATA[<p>Après avoir été nominé MVP Visual C++ en 2007, puis MVP ASP.NET en 2010, me voilà désormais MVP Visual C# pour 2012.</p>
<p>Je reconnais que ce blog est de moins en moins mis à jour mais je vais essayer de me rattraper <img src="https://blog.developpez.com/nico-pyright/wp-includes/images/smilies/icon_wink.gif" alt=";)" class="wp-smiley" /></p>
<p>Merci encore à Microsoft de me renouveler sa confiance. J&rsquo;en profite au passage pour vous souhaitez à tous une bonne année, pleine de C# et de .NET.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tutoriel : introduction au développement d&#8217;applications Windows Phone 7</title>
		<link>https://blog.developpez.com/nico-pyright/p9484/c/tutoriel_introduction_au_developpement_d_7</link>
		<comments>https://blog.developpez.com/nico-pyright/p9484/c/tutoriel_introduction_au_developpement_d_7#comments</comments>
		<pubDate>Sun, 14 Nov 2010 23:00:00 +0000</pubDate>
		<dc:creator><![CDATA[nico-pyright(c)]]></dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Windows Phone 7 (WP7) est la nouvelle plateforme de développement de Microsoft destinée aux smartphones. Dans ce premier tutoriel, vous découvrirez comment démarrer le développement d&#8217;applications avec Windows Phone 7. Nous commencerons par installer les outils nécessaires au développement sur WP7 puis nous créerons un premier programme simpliste en utilisant Silverlight pour WP7. Enfin, nous l&#8217;exécuterons sur l&#8217;émulateur et découvrirons son fonctionnement. Bonne lecture : http://nico-pyright.developpez.com/tutoriel/vs2010/csharp/windows-phone-seven/introduction-developpement-windows-phone-seven-wp7-silverlight/]]></description>
				<content:encoded><![CDATA[<p>Windows Phone 7 (WP7) est la nouvelle plateforme de développement de Microsoft destinée aux smartphones.</p>
<p>Dans ce premier tutoriel, vous découvrirez comment démarrer le développement d&rsquo;applications avec Windows Phone 7.<br />
Nous commencerons par installer les outils nécessaires au développement sur WP7 puis nous créerons un premier programme simpliste en utilisant Silverlight pour WP7.<br />
Enfin, nous l&rsquo;exécuterons sur l&rsquo;émulateur et découvrirons son fonctionnement.</p>
<p>Bonne lecture : http://nico-pyright.developpez.com/tutoriel/vs2010/csharp/windows-phone-seven/introduction-developpement-windows-phone-seven-wp7-silverlight/</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ASP.NET][AJAX]PageMethods is not defined, comment le corriger ?</title>
		<link>https://blog.developpez.com/nico-pyright/p8442/c/asp_net_ajax_pagemethods_is_not_defined</link>
		<comments>https://blog.developpez.com/nico-pyright/p8442/c/asp_net_ajax_pagemethods_is_not_defined#comments</comments>
		<pubDate>Tue, 08 Dec 2009 20:18:00 +0000</pubDate>
		<dc:creator><![CDATA[nico-pyright(c)]]></dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Si vous développez avec ASP.NET et que vous voulez faire de l&#8217;Ajax, vous vous êtres probablement intéressés aux PageMethods. Pour rappel, on peut utiliser les PageMethods de cette façon. Si vous avez utilisé les PageMethods, vous vous heurterez fatalement à l&#8217;erreur suivante : PageMethods is not defined Sisi, je vous assure Voici ce que vous pouvez faire et vérifier pour que ce message qui révèle toute notre impuissance face au framework ASP.NET puisse enfin disparaitre [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Si vous développez avec ASP.NET et que vous voulez faire de l&rsquo;Ajax, vous vous êtres probablement intéressés aux PageMethods.</p>
<p>Pour rappel, on peut utiliser <a href="http://nico-pyright.developpez.com/tutoriel/asp.net/ajax/compareaspnetajaxmethod/#Lpartialrenderingwithpagemethods" target="_blank">les PageMethods de cette façon</a>.</p>
<p>Si vous avez utilisé les PageMethods, vous vous heurterez fatalement à l&rsquo;erreur suivante :</p>
<p> <code class="codecolorer text default"><span class="text">PageMethods is not defined</span></code>
<p>Sisi, je vous assure <img src="https://blog.developpez.com/nico-pyright/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p>
<p>Voici ce que vous pouvez faire et vérifier pour que ce message qui révèle toute notre impuissance face au framework ASP.NET puisse enfin disparaitre :</p>
<p>  <span id="more-55"></span>
<ul>
<li>Vérifier que la méthode que vous souhaitez appeler est marquée comme [WebMethod]</li>
<li>Vérifier que la méthode est statique</li>
<li>Vérifier que le script manager est présent sur la page</li>
<li>Vérifier qu&rsquo;il a bien l&rsquo;attribut EnablePageMethods à True</li>
</ul>
<p>Pour vérifier que le proxy est bien généré, afficher le code source de la page et chercher le mot clé &laquo;&nbsp;PageMethods&nbsp;&raquo;, s&rsquo;il est absent, cela ne pourra pas marcher.</p>
<p>Vous pouvez ensuite :</p>
<ul>
<li>Vérifier que la méthode fasse bien partie du code-behind de la page (cela ne fonctionne pas toujours sur le code-behind d&rsquo;un usercontrol)</li>
<li>Nettoyer la solution (clean) et supprimer les fichiers dans C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files</li>
</ul>
<p>Après, il ne reste plus qu&rsquo;à allumer un cierge ou utiliser une des autres méthodes décrites <a href="http://nico-pyright.developpez.com/tutoriel/asp.net/ajax/compareaspnetajaxmethod/" target="_blank">dans ce tutoriel</a>.</p>
<p>Vous souhaitant la disparition de cette erreur.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ASP.NET][C#] Mise à jour multiple de pages avec un UpdatePanel</title>
		<link>https://blog.developpez.com/nico-pyright/p7962/c/asp_net_c_mise_a_jour_multiple_de_pages_</link>
		<comments>https://blog.developpez.com/nico-pyright/p7962/c/asp_net_c_mise_a_jour_multiple_de_pages_#comments</comments>
		<pubDate>Tue, 18 Aug 2009 20:32:07 +0000</pubDate>
		<dc:creator><![CDATA[nico-pyright(c)]]></dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[On l&#8217;a souvent vu, l&#8217;utilisation de l&#8217;updatepanel est très pratique et améliore très facilement l&#8217;expérience utilisateur d&#8217;un site web. Mal utilisé, celui-ci peut récupérer beaucoup plus d&#8217;informations que nécessaire. Que faire par exemple dans le cas simple suivant, lorsque l&#8217;on doit mettre à jour plusieurs zones en même temps d&#8217;une page volumineuse ? Quelque chose dans ce genre : &#160; &#160; Début à rafraichir &#160; Long milieu (images et textes statiques à foison) &#160; Fin [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>On l&rsquo;a souvent vu, l&rsquo;utilisation de l&rsquo;updatepanel est très pratique et améliore très facilement l&rsquo;expérience utilisateur d&rsquo;un site web.<br />
  <br />Mal utilisé, celui-ci peut récupérer beaucoup plus d&rsquo;informations que nécessaire. </p>
<p>Que faire par exemple dans le cas simple suivant, lorsque l&rsquo;on doit mettre à jour plusieurs zones en même temps d&rsquo;une page volumineuse ? </p>
<p>Quelque chose dans ce genre :</p>
<p>&#160;</p>
<div style="border-bottom: #000000 1px solid; border-left: #000000 1px solid; margin-left: 10pt; border-top: #000000 1px solid; margin-right: 2pt; border-right: #000000 1px solid">
<div style="background-color: #dcdcdc; white-space: nowrap; overflow: scroll"><font face=" Courier New"><font size="2">&#160; Début à rafraichir </p>
<p>&#160; Long milieu (images et textes statiques à foison) </p>
<p>&#160; Fin à rafraichir</font></font> </div>
</div>
<p><span id="more-95"></span></p>
<p>Par exemple : </p>
<div style="border-bottom: #000000 1px solid; border-left: #000000 1px solid; margin-left: 10pt; border-top: #000000 1px solid; margin-right: 2pt; border-right: #000000 1px solid">
<div style="background-color: #dcdcdc; white-space: nowrap; overflow: scroll"><font face=" Courier New"><font size="2"></font><font color="#0000ff">&lt;</font><font color="#000000">%</font><font color="#a31515">@</font><font color="#0000ff">&#160;</font><font color="#ff0000">Page</font><font color="#0000ff">=</font><font color="#000000">&quot;&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">Language</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">C#</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">AutoEventWireup</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">false</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">CodeBehind</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">Default.aspx.cs</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">Inherits</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">testUpdatePanel._Default</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#000000">%</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;!</font><font color="#a31515">DOCTYPE</font><font color="#0000ff">&#160;</font><font color="#ff0000">html</font><font color="#0000ff"> PUBLIC </font><font color="#000000">&quot;</font><font color="#0000ff">-//W3C//DTD XHTML 1.0 Transitional//EN</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#000000">&quot;</font><font color="#0000ff">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</font><font color="#000000">&quot;</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;</font><font color="#a31515">html</font><font color="#0000ff">&#160;</font><font color="#ff0000">xmlns</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">http://www.w3.org/1999/xhtml</font><font color="#000000">&quot;</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160; &lt;</font><font color="#a31515">head</font><font color="#0000ff">&#160;</font><font color="#ff0000">id</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">Head1</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">title</font><font color="#0000ff">&gt;&lt;/</font><font color="#a31515">title</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160; &lt;/</font><font color="#a31515">head</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160; &lt;</font><font color="#a31515">body</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">form</font><font color="#0000ff">&#160;</font><font color="#ff0000">id</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">form1</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">p</font><font color="#0000ff">&gt;</font><font color="#000000">Premier bloc à rafraichir</font><font color="#0000ff">&lt;/</font><font color="#a31515">p</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">asp:Label</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">label1</font><font color="#000000">&quot;</font><font color="#0000ff"> /&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">p</font><font color="#0000ff">&gt;</font><font color="#000000">Long bloc à ne pas rafraichir</font><font color="#0000ff">&lt;/</font><font color="#a31515">p</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">p</font><font color="#0000ff">&gt;</font><font color="#000000">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas dignissim fermentum est at porta. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque dui lacus, ultricies ac vestibulum eu, interdum at nisl. Proin pharetra ipsum pharetra justo pharetra ornare. Integer sed enim sit amet erat suscipit sodales. Pellentesque mi dui, luctus vitae semper quis, scelerisque id orci. Praesent mattis nisi sed eros faucibus non adipiscing libero tincidunt. Aenean sollicitudin sapien ac nulla porta gravida. Phasellus ipsum arcu, aliquam semper ullamcorper quis, ultricies quis lacus. Sed porttitor, purus quis mollis interdum, dui orci feugiat nibh, non tincidunt risus lacus ut massa. Morbi eget sem id mi posuere congue. Aliquam erat volutpat. Vivamus elementum ligula augue. </font><font color="#0000ff">&lt;/</font><font color="#a31515">p</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">p</font><font color="#0000ff">&gt;</font><font color="#000000">Aenean pellentesque felis at nunc aliquet vitae porta est cursus. In hac habitasse platea dictumst. Donec arcu felis, suscipit vitae fermentum vitae, auctor ut justo. In egestas interdum erat, vel interdum nisi adipiscing sit amet. Aliquam vitae neque vel erat tempor mollis sed ac sapien. Nam sed velit ut lectus sagittis feugiat ac ut ante. Quisque non nunc lacus. Aliquam lobortis risus ac tortor cursus at tincidunt libero vulputate. Curabitur eu pellentesque diam. Vestibulum tristique tempus sollicitudin. Vestibulum pretium ipsum vitae diam bibendum placerat. Donec vel egestas augue. Suspendisse id placerat tortor. Maecenas pellentesque metus et nunc mollis id pretium tellus tincidunt. Nulla mollis cursus ligula, nec hendrerit tortor feugiat nec. In egestas, nulla ac gravida laoreet, tortor sem sollicitudin turpis, a mollis sem lectus in ipsum. Phasellus egestas fermentum lacus feugiat auctor. Aliquam augue risus, venenatis nec gravida quis, dignissim sagittis massa. Ut dapibus rhoncus sodales.</font><font color="#0000ff">&lt;/</font><font color="#a31515">p</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">asp:Label</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">label2</font><font color="#000000">&quot;</font><font color="#0000ff"> /&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">p</font><font color="#0000ff">&gt;</font><font color="#000000">Dernier bloc à rafraichir</font><font color="#0000ff">&lt;/</font><font color="#a31515">p</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">asp:Label</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">label3</font><font color="#000000">&quot;</font><font color="#0000ff"> /&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">asp:Button</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">Text</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">Go</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">OnClick</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">OnButtonClick</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">button1</font><font color="#000000">&quot;</font><font color="#0000ff"> /&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160; &lt;/</font><font color="#a31515">form</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160; &lt;/</font><font color="#a31515">body</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;/</font><font color="#a31515">html</font><font color="#0000ff">&gt;</font></font> </div>
</div>
<p>L&rsquo;utilisateur non averti pourrait être tenté de mettre un UpdatePanel sur toute la page, ce qui fonctionnerait mais aurait pour effet de rafraîchir toute la page et par la même occasion la portion statique inutile.<br />
  <br />Un autre utilisateur au courant de cet effet pourrait être tenté d&rsquo;utiliser 2 UpdatePanel, mais comment les organiser ? </p>
<p>Si j&rsquo;entoure mes deux blocs avec des UpdatePanel, c&rsquo;est à dire : </p>
<p>&#160;</p>
<div style="border-bottom: #000000 1px solid; border-left: #000000 1px solid; margin-left: 10pt; border-top: #000000 1px solid; margin-right: 2pt; border-right: #000000 1px solid">
<div style="background-color: #dcdcdc; white-space: nowrap; overflow: scroll"><font face=" Courier New"><font size="2"></font><font color="#0000ff">&lt;</font><font color="#a31515">asp:ScriptManager</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">ScriptManager1</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff"> /&gt;<br />
        <br />&lt;</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;</font><font color="#a31515">p</font><font color="#0000ff">&gt;</font><font color="#000000">Premier bloc à rafraichir</font><font color="#0000ff">&lt;/</font><font color="#a31515">p</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;</font><font color="#a31515">asp:UpdatePanel</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">updatePanel1</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">UpdateMode</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">Conditional</font><font color="#000000">&quot;</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160; &lt;</font><font color="#a31515">ContentTemplate</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">asp:Label</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">label1</font><font color="#000000">&quot;</font><font color="#0000ff"> /&gt;<br />
        <br />&#160;&#160;&#160; &lt;/</font><font color="#a31515">ContentTemplate</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;/</font><font color="#a31515">asp:UpdatePanel</font><font color="#0000ff">&gt;<br />
        <br />&lt;/</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&lt;</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;</font><font color="#a31515">p</font><font color="#0000ff">&gt;</font><font color="#000000">Long bloc ? ne pas rafraichir</font><font color="#0000ff">&lt;/</font><font color="#a31515">p</font><font color="#0000ff">&gt;<br />
        <br /></font><font color="#000000">&#160; [&#8230;]Code inutile enlevé [&#8230;]<br />
        <br /></font><font color="#0000ff">&lt;/</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&lt;</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;</font><font color="#a31515">p</font><font color="#0000ff">&gt;</font><font color="#000000">Dernier bloc à rafraichir</font><font color="#0000ff">&lt;/</font><font color="#a31515">p</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;</font><font color="#a31515">asp:UpdatePanel</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">updatePanel2</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">UpdateMode</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">Conditional</font><font color="#000000">&quot;</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160; &lt;</font><font color="#a31515">ContentTemplate</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">asp:Label</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">label3</font><font color="#000000">&quot;</font><font color="#0000ff"> /&gt;<br />
        <br />&#160;&#160;&#160; &lt;/</font><font color="#a31515">ContentTemplate</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;/</font><font color="#a31515">asp:UpdatePanel</font><font color="#0000ff">&gt;<br />
        <br />&lt;/</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&lt;</font><font color="#a31515">asp:Button</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">Text</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">Go</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">OnClick</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">OnButtonClick</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">button1</font><font color="#000000">&quot;</font><font color="#0000ff"> /&gt;</font></font> </div>
</div>
<p>Cela ne fonctionne pas, car l&rsquo;événement du bouton n&rsquo;est pas attrapé par l&rsquo;UpdatePanel, le bouton n&rsquo;étant pas dans le contrôle. </p>
<p>Si j&rsquo;agrandis la zone du deuxième UpdatePanel pour entourer le bouton, cela ne rafraîchit que le deuxième UpdatePanel, normal &#8230; </p>
<p><strong>La solution est bien d&rsquo;utiliser 2 UpdatePanel</strong>, effectivement. Il faut toujours veiller à ne pas englober des zones inutiles et à réduire au maximum les zones à mettre à jour.<br />
  <br />Il faudra par contre leurs indiquer de surveiller l&rsquo;événement click du bouton. Pour ce faire, on utilisera les Triggers et plus particulièrement l&rsquo;AsyncPostBackTrigger, comme ceci :</p>
<div style="border-bottom: #000000 1px solid; border-left: #000000 1px solid; margin-left: 10pt; border-top: #000000 1px solid; margin-right: 2pt; border-right: #000000 1px solid">
<div style="background-color: #dcdcdc; white-space: nowrap; overflow: scroll"><font face=" Courier New"><font size="2"></font><font color="#0000ff">&lt;</font><font color="#000000">%</font><font color="#a31515">@</font><font color="#0000ff">&#160;</font><font color="#ff0000">Page</font><font color="#0000ff">=</font><font color="#000000">&quot;&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">Language</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">C#</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">AutoEventWireup</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">false</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">CodeBehind</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">Default.aspx.cs</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">Inherits</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">testUpdatePanel._Default</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#000000">%</font><font color="#0000ff">&gt;</p>
<p>&#160; &lt;</font><font color="#a31515">asp:ScriptManager</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff"> /&gt;<br />
        <br />&#160; &lt;</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160; &lt;</font><font color="#a31515">p</font><font color="#0000ff">&gt;</font><font color="#000000">Premier bloc à rafraichir</font><font color="#0000ff">&lt;/</font><font color="#a31515">p</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160; &lt;</font><font color="#a31515">asp:UpdatePanel</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">updatePanel1</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">UpdateMode</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">Conditional</font><font color="#000000">&quot;</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">ContentTemplate</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">asp:Label</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">label1</font><font color="#000000">&quot;</font><font color="#0000ff"> /&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160; &lt;/</font><font color="#a31515">ContentTemplate</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">Triggers</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">asp:AsyncPostBackTrigger</font><font color="#0000ff">&#160;</font><font color="#ff0000">ControlID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">button1</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">EventName</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">Click</font><font color="#000000">&quot;</font><font color="#0000ff"> /&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160; &lt;/</font><font color="#a31515">Triggers</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160; &lt;/</font><font color="#a31515">asp:UpdatePanel</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;/</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160; &lt;</font><font color="#a31515">p</font><font color="#0000ff">&gt;</font><font color="#000000">Long bloc à ne pas rafraichir</font><font color="#0000ff">&lt;/</font><font color="#a31515">p</font><font color="#0000ff">&gt;<br />
        <br /></font><font color="#000000">&#160;&#160;&#160; [&#8230;]Code inutile enlevé [&#8230;]<br />
        <br /></font><font color="#0000ff">&#160; &lt;/</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160; &lt;</font><font color="#a31515">p</font><font color="#0000ff">&gt;</font><font color="#000000">Dernier bloc à rafraichir</font><font color="#0000ff">&lt;/</font><font color="#a31515">p</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160; &lt;</font><font color="#a31515">asp:UpdatePanel</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">updatePanel2</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">UpdateMode</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">Conditional</font><font color="#000000">&quot;</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">ContentTemplate</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">asp:Label</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">label3</font><font color="#000000">&quot;</font><font color="#0000ff"> /&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160; &lt;/</font><font color="#a31515">ContentTemplate</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">Triggers</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font><font color="#a31515">asp:AsyncPostBackTrigger</font><font color="#0000ff">&#160;</font><font color="#ff0000">ControlID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">button1</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">EventName</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">Click</font><font color="#000000">&quot;</font><font color="#0000ff"> /&gt;<br />
        <br />&#160;&#160;&#160;&#160;&#160; &lt;/</font><font color="#a31515">Triggers</font><font color="#0000ff">&gt;<br />
        <br />&#160;&#160;&#160; &lt;/</font><font color="#a31515">asp:UpdatePanel</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;/</font><font color="#a31515">div</font><font color="#0000ff">&gt;<br />
        <br />&#160; &lt;</font><font color="#a31515">asp:Button</font><font color="#0000ff">&#160;</font><font color="#ff0000">runat</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">server</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">Text</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">Go</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">OnClick</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">OnButtonClick</font><font color="#000000">&quot;</font><font color="#0000ff">&#160;</font><font color="#ff0000">ID</font><font color="#0000ff">=</font><font color="#000000">&quot;</font><font color="#0000ff">button1</font><font color="#000000">&quot;</font><font color="#0000ff"> /&gt;</font></font> </div>
</div>
<p>Et voilà, le minimum de code est rafraîchit et transite à travers le reseau. </p>
<p>Note : la mise à jour des labels se fait par exemple dans le OnLoad :</p>
<p>&#160;</p>
<div style="border-bottom: #000000 1px solid; border-left: #000000 1px solid; margin-left: 10pt; border-top: #000000 1px solid; margin-right: 2pt; border-right: #000000 1px solid">
<div style="background-color: #dcdcdc; white-space: nowrap; overflow: scroll"><font face=" Courier New"><font size="2"></font><font color="#0000ff">protected</font><font color="#000000">&#160;</font><font color="#0000ff">override</font><font color="#000000">&#160;</font><font color="#0000ff">void</font><font color="#000000"> OnLoad(</font><font color="#2b91af">EventArgs</font><font color="#000000"> e)<br />
        <br />{</p>
<p>&#160;&#160;&#160; label1.Text = </font><font color="#2b91af">DateTime</font><font color="#000000">.Now.ToLongTimeString();<br />
        <br />&#160;&#160;&#160; label2.Text = </font><font color="#2b91af">DateTime</font><font color="#000000">.Now.ToLongTimeString();<br />
        <br />&#160;&#160;&#160; label3.Text = </font><font color="#2b91af">DateTime</font><font color="#000000">.Now.ToLongTimeString();<br />
        <br />&#160;&#160;&#160; </font><font color="#0000ff">base</font><font color="#000000">.OnLoad(e);<br />
        <br />}</font></font> </div>
</div>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[C#][Silverlight] Mise à jour du tutoriel sur l&#8217;upload de fichier en Silverlight 2 sur un serveur PHP</title>
		<link>https://blog.developpez.com/nico-pyright/p7500/ajax/c_silverlight_mise_a_jour_du_tutoriel_su</link>
		<comments>https://blog.developpez.com/nico-pyright/p7500/ajax/c_silverlight_mise_a_jour_du_tutoriel_su#comments</comments>
		<pubDate>Sat, 18 Apr 2009 19:42:58 +0000</pubDate>
		<dc:creator><![CDATA[nico-pyright(c)]]></dc:creator>
				<category><![CDATA[Ajax]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Après avoir utilisé l&#8217;upload de fichier de manière plus poussée, je me suis rendu compte que tout n&#8217;était pas encore parfait. J&#8217;ai donc procédé à quelques nouvelles améliorations. &#8211; Vérification d&#8217;envoi à chaque envoi de données &#8211; Catch plus complet des erreurs Retrouvez l&#8217;article mis à jour à cette adresse et notamment ce paragraphe. La classe WSUploader a été mise à jour avec ces améliorations.]]></description>
				<content:encoded><![CDATA[<p>Après avoir utilisé l&rsquo;upload de fichier de manière plus poussée, je me suis rendu compte que tout n&rsquo;était pas encore parfait. J&rsquo;ai donc procédé à quelques nouvelles améliorations.</p>
<p>&#8211; Vérification d&rsquo;envoi à chaque envoi de données<br />
&#8211; Catch plus complet des erreurs</p>
<p>Retrouvez l&rsquo;article mis à jour <a href="http://nico-pyright.developpez.com/tutoriel/vs2008/csharp/uploadsilverlightandphp/">à cette adresse</a> et notamment <a href="http://nico-pyright.developpez.com/tutoriel/vs2008/csharp/uploadsilverlightandphp/#Limprovements">ce paragraphe</a>.</p>
<p>La classe WSUploader a été mise à jour avec ces améliorations.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ASP.NET] [C#] Tutoriel : Permettre la navigation et le bookmarking avec une application ASP.NET Ajax</title>
		<link>https://blog.developpez.com/nico-pyright/p7488/ajax/asp_net_c_tutoriel_permettre_la_navigati</link>
		<comments>https://blog.developpez.com/nico-pyright/p7488/ajax/asp_net_c_tutoriel_permettre_la_navigati#comments</comments>
		<pubDate>Tue, 14 Apr 2009 23:00:00 +0000</pubDate>
		<dc:creator><![CDATA[nico-pyright(c)]]></dc:creator>
				<category><![CDATA[Ajax]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Je vous présente dans ce nouvel article une solution pour gérer l&#8217;historique dans un site ASP.NET utilisant de l&#8217;Ajax. Nous verrons notamment l&#8217;utilisation du composant ScriptManager et comment mettre à profit sa propriété EnableHistory. Lire l&#8217;article]]></description>
				<content:encoded><![CDATA[<p>Je vous présente dans ce nouvel article une solution pour gérer l&rsquo;historique dans un site ASP.NET utilisant de l&rsquo;Ajax.<br />
Nous verrons notamment l&rsquo;utilisation du composant ScriptManager et comment mettre à profit sa propriété EnableHistory.</p>
<p><a href="http://nico-pyright.developpez.com/tutoriel/asp.net/csharp/historyajax/">Lire l&rsquo;article</a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ASP.NET] Tutoriel : Créer un overlayer d&#8217;attente lors d&#8217;un postback pour ASP.NET/AJAX en C#</title>
		<link>https://blog.developpez.com/nico-pyright/p6110/c/asp_net_tutoriel_creer_un_overlayer_d_at</link>
		<comments>https://blog.developpez.com/nico-pyright/p6110/c/asp_net_tutoriel_creer_un_overlayer_d_at#comments</comments>
		<pubDate>Wed, 23 Jul 2008 23:00:00 +0000</pubDate>
		<dc:creator><![CDATA[nico-pyright(c)]]></dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Je vous présente ici comment créer un contrôle qui affiche un overlayer d&#8217;attente pendant un postback partiel AJAX pour ASP.NET en C#. Vous y verrez comment encapsuler le contrôle UpdateProgress et vous aurez un aperçu du cycle de vie client d&#8217;un postback AJAX Aller à l&#8217;article Bonne lecture]]></description>
				<content:encoded><![CDATA[<p>Je vous présente ici comment créer un contrôle qui affiche un overlayer d&rsquo;attente pendant un postback partiel AJAX pour ASP.NET en C#. Vous y verrez comment encapsuler le contrôle UpdateProgress et vous aurez un aperçu du cycle de vie client d&rsquo;un postback AJAX</p>
<p><a href="http://nico-pyright.developpez.com/tutoriel/asp.net/csharp/updateprogresscontrol/">Aller à l&rsquo;article</a></p>
<p>Bonne lecture</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Asp.Net, Ajax] Utiliser l&#8217;UpdatePanel pour raffraichir une DropDownList dans un Repeater</title>
		<link>https://blog.developpez.com/nico-pyright/p5390/c/asp_net_ajax_utiliser_l_updatepanel_pour</link>
		<comments>https://blog.developpez.com/nico-pyright/p5390/c/asp_net_ajax_utiliser_l_updatepanel_pour#comments</comments>
		<pubDate>Sat, 29 Mar 2008 20:00:00 +0000</pubDate>
		<dc:creator><![CDATA[nico-pyright(c)]]></dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Suite à mon précédent billet, cette fois-ci nous allons voir l&#8217;utilisation de l&#8217;updatePanel dans un repeater. Soit le repeater suivant, qui contient une dropdown pour chaque item de la collection qui lui est bindée : &#60;asp:Repeater ID=&#34;LeRepeater&#34; runat=&#34;server&#34; DataSource=&#34;&#60;%# new int[] {1, 6, 11} %&#62;&#34; OnItemDataBound=&#34;ItemDataBound&#34;&#62; &#160; &#160; &#60;ItemTemplate&#62; &#160; &#160; &#160; &#160; &#60;asp:DropDownList runat=&#34;server&#34; ID=&#34;LaList&#34; AutoPostBack=&#34;true&#34; OnSelectedIndexChanged=&#34;IndexChange&#34;&#62; &#160; &#160; &#160; &#160; &#60;/asp:DropDownList&#62; &#160; &#160; &#60;/ItemTemplate&#62; &#60;/asp:Repeater&#62; Le code behind est le suivant : protected [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Suite à mon précédent billet, cette fois-ci nous allons voir l&rsquo;utilisation de l&rsquo;updatePanel dans un repeater.</p>
<p>Soit le repeater suivant, qui contient une dropdown pour chaque item de la collection qui lui est bindée :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;asp:Repeater ID=&quot;LeRepeater&quot; runat=&quot;server&quot; DataSource=&quot;&lt;%# new int[] {1, 6, 11} %&gt;&quot; OnItemDataBound=&quot;ItemDataBound&quot;&gt; <br />
&nbsp; &nbsp; &lt;ItemTemplate&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:DropDownList runat=&quot;server&quot; ID=&quot;LaList&quot; AutoPostBack=&quot;true&quot; OnSelectedIndexChanged=&quot;IndexChange&quot;&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/asp:DropDownList&gt; <br />
&nbsp; &nbsp; &lt;/ItemTemplate&gt; <br />
&lt;/asp:Repeater&gt;</div></div>
<p>Le code behind est le suivant :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">protected override void OnLoad(EventArgs e) <br />
{ <br />
&nbsp; &nbsp; if (!IsPostBack) <br />
&nbsp; &nbsp; &nbsp; &nbsp; LeRepeater.DataBind(); <br />
&nbsp;<br />
&nbsp; &nbsp; LeLabel.Text = DateTime.Now.ToString(); <br />
&nbsp; &nbsp; base.OnLoad(e); <br />
} <br />
&nbsp;<br />
protected void IndexChange(object sender, EventArgs e) <br />
{ <br />
&nbsp; &nbsp; Result.Text = string.Format(&quot;Valeur choisie : {0}&quot;, ((DropDownList)sender).SelectedValue); <br />
} <br />
&nbsp;<br />
protected void ItemDataBound(object sender, RepeaterItemEventArgs e) <br />
{ <br />
&nbsp; &nbsp; if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) <br />
&nbsp; &nbsp; { <br />
&nbsp; &nbsp; &nbsp; &nbsp; DropDownList LaList = (DropDownList)e.Item.FindControl(&quot;LaList&quot;); <br />
&nbsp; &nbsp; &nbsp; &nbsp; for (int i = (int)e.Item.DataItem; i &lt; (int)e.Item.DataItem + 5; i++) <br />
&nbsp; &nbsp; &nbsp; &nbsp; { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LaList.Items.Add(new ListItem(i.ToString(), i.ToString())); <br />
&nbsp; &nbsp; &nbsp; &nbsp; } <br />
&nbsp; &nbsp; } <br />
}</div></div>
<p>Ce qui fait qu&rsquo;on se retrouve avec trois dropDown. La première va de 1 à 5, la seconde de 6 à 10 et la troisième de 11 à 15. Et lorsqu&rsquo;on sélectionne une valeur, elle s&rsquo;affiche dans un label.</p>
<p><span id="more-79"></span></p>
<p>Si on essaie comme dans le billet précédent d&rsquo;encadrer par un UpdatePanel :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;asp:ScriptManager ID=&quot;ScriptManager1&quot; runat=&quot;server&quot;&gt; <br />
&lt;/asp:ScriptManager&gt; <br />
&nbsp;<br />
&lt;asp:Label runat=&quot;server&quot; id=&quot;LeLabel&quot;/&gt; <br />
&nbsp;<br />
&lt;asp:UpdatePanel runat=&quot;server&quot; ID=&quot;UpdatePanel1&quot;&gt; <br />
&nbsp; &nbsp; &lt;ContentTemplate&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Repeater ID=&quot;LeRepeater&quot; runat=&quot;server&quot; DataSource=&quot;&lt;%# new int[] {1, 6, 11} %&gt;&quot; OnItemDataBound=&quot;ItemDataBound&quot;&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ItemTemplate&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:DropDownList runat=&quot;server&quot; ID=&quot;LaList&quot; AutoPostBack=&quot;true&quot; OnSelectedIndexChanged=&quot;IndexChange&quot;&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/asp:DropDownList&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/ItemTemplate&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/asp:Repeater&gt; <br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Label runat=&quot;server&quot; ID=&quot;Result&quot; /&gt; <br />
&nbsp; &nbsp; &lt;/ContentTemplate&gt; <br />
&nbsp; &nbsp; &lt;Triggers&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:AsyncPostBackTrigger ControlID=&quot;LaList&quot; EventName=&quot;SelectedIndexChanged&quot; /&gt; <br />
&nbsp; &nbsp; &lt;/Triggers&gt; <br />
&lt;/asp:UpdatePanel&gt;</div></div>
<p>Au démarrage, on obtient l&rsquo;erreur suivante :</p>
<blockquote><p>A control with ID &lsquo;LaList&rsquo; could not be found for the trigger in UpdatePanel &lsquo;UpdatePanel1&prime;. </p></blockquote>
<p>C&rsquo;est l&rsquo;utilisation de l&rsquo;AsyncPostBackTrigger qui pose problème.<br />
Pour corriger ce problème, nous allons le retirer de la page aspx et modifier le code behind pour en ajouter un dynamiquement, à chaque DataBound du repeater.<br />
Ainsi, la méthode devient :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">protected void ItemDataBound(object sender, RepeaterItemEventArgs e) <br />
{ <br />
&nbsp; &nbsp; if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) <br />
&nbsp; &nbsp; { <br />
&nbsp; &nbsp; &nbsp; &nbsp; DropDownList LaList = (DropDownList)e.Item.FindControl(&quot;LaList&quot;); <br />
&nbsp; &nbsp; &nbsp; &nbsp; for (int i = (int)e.Item.DataItem; i &lt; (int)e.Item.DataItem + 5; i++) <br />
&nbsp; &nbsp; &nbsp; &nbsp; { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LaList.Items.Add(new ListItem(i.ToString(), i.ToString())); <br />
&nbsp; &nbsp; &nbsp; &nbsp; } <br />
&nbsp; &nbsp; &nbsp; &nbsp; AsyncPostBackTrigger trigger = new AsyncPostBackTrigger(); <br />
&nbsp; &nbsp; &nbsp; &nbsp; trigger.ControlID = LaList.UniqueID; <br />
&nbsp; &nbsp; &nbsp; &nbsp; trigger.EventName = &quot;SelectedIndexChanged&quot;; <br />
&nbsp; &nbsp; &nbsp; &nbsp; UpdatePanel1.Triggers.Add(trigger); <br />
&nbsp; &nbsp; } <br />
}</div></div>
<p>Et voilà.</p>
<p><a href="ftp://ftp-developpez.com/nico-pyright/blog/demoRepeaterUpdatePanelDropDown.rar">Télécharger le projet démo (13 ko)</a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>[Asp.Net, Ajax] Utiliser l&#8217;UpdatePanel avec une DropDownList</title>
		<link>https://blog.developpez.com/nico-pyright/p5389/asp-net/asp_net_ajax_utiliser_l_updatepanel_avec</link>
		<comments>https://blog.developpez.com/nico-pyright/p5389/asp-net/asp_net_ajax_utiliser_l_updatepanel_avec#comments</comments>
		<pubDate>Fri, 28 Mar 2008 20:00:00 +0000</pubDate>
		<dc:creator><![CDATA[nico-pyright(c)]]></dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ASP.Net]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[J&#8217;aime beaucoup la fonctionnalité AutoPostBack d&#8217;une dropdownlist. Le seul inconvénient est qu&#8217;elle provoque un postback &#8230; et que forcément, ca provoque un rechargement complet de la page. Ce qui peut etre génant pour l&#8217;utilisateur si la page est plutot grosse. Dans ce monde Web 2.0, vous me direz &#8230; AJAX. Et je vous dirais &#8230; allons-y ! tout d&#8217;abord, il vous faut bien sur les web extensions ajax. Si vous utilisez visual studio 2005, un [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>J&rsquo;aime beaucoup la fonctionnalité AutoPostBack d&rsquo;une dropdownlist. Le seul inconvénient est qu&rsquo;elle provoque un postback &#8230; et que forcément, ca provoque un rechargement complet de la page. Ce qui peut etre génant pour l&rsquo;utilisateur si la page est plutot grosse.</p>
<p>Dans ce monde Web 2.0, vous me direz &#8230; AJAX.</p>
<p>Et je vous dirais &#8230; allons-y ! <img src="https://blog.developpez.com/nico-pyright/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /><br />
<span id="more-78"></span></p>
<p>tout d&rsquo;abord, il vous faut bien sur les web extensions ajax.<br />
Si vous utilisez visual studio 2005, un petit tour de ce coté http://asp.net/ajax/downloads/ pour les installer.<br />
N&rsquo;oubliez pas non plus d&rsquo;aller modifier votre web.config et d&rsquo;ajouter</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;httpHandlers&gt; <br />
&nbsp; &nbsp; &lt;add verb=&quot;GET,HEAD&quot; path=&quot;ScriptResource.axd&quot; type=&quot;System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; validate=&quot;false&quot;/&gt; <br />
&lt;/httpHandlers&gt;</div></div>
<p>(dans la section <system.web>)</p>
<p>sinon, vous aurez la fameuse erreur javascript </p>
<blockquote><p>Sys is not defined</p></blockquote>
<p>témoin que les scripts Ajax ne sont pas chargés.</p>
<p>Si vous etes sous visual studio 2008, il vous suffit de cibler le framework 3.5</p>
<p>Ensuite, en imaginant que vous ayez une page comme celle-ci :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;div&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:DropDownList runat=&quot;server&quot; ID=&quot;GroupNumbers&quot; AutoPostBack=&quot;true&quot; OnSelectedIndexChanged=&quot;DropDownChange&quot;&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:ListItem Text=&quot;Choisir ...&quot; Value=&quot;&quot; /&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:ListItem Text=&quot;1 --&gt; 5&quot; Value=&quot;1&quot; /&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:ListItem Text=&quot;6 --&gt; 10&quot; Value=&quot;2&quot; /&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:ListItem Text=&quot;11 --&gt; 15&quot; Value=&quot;3&quot; /&gt; <br />
&nbsp; &nbsp; &lt;/asp:DropDownList&gt; <br />
&lt;/div&gt; <br />
&nbsp;<br />
&lt;asp:DropDownList runat=&quot;server&quot; ID=&quot;Numbers&quot; AutoPostBack=&quot;true&quot; OnSelectedIndexChanged=&quot;Numbers_SelectedIndexChanged&quot; Visible=&quot;false&quot;&gt; <br />
&lt;/asp:DropDownList&gt; <br />
&lt;asp:Label runat=&quot;server&quot; ID=&quot;Result&quot; Visible=&quot;false&quot; /&gt;</div></div>
<p>Donc, une première DropDown qui contient des plages de nombres et une fois une de ces plages choisies, on affiche une deuxième dropdown avec le contenu de cette plage. Et lorsqu&rsquo;une valeur de la deuxième liste est choisi, on affiche le résultat dans un label.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">protected void DropDownChange(object sender, EventArgs e) <br />
{ <br />
&nbsp; &nbsp; Thread.Sleep(2000); <br />
&nbsp; &nbsp; Result.Visible = false; <br />
&nbsp; &nbsp; Numbers.Visible = false; <br />
&nbsp; &nbsp; int valSelected; <br />
&nbsp; &nbsp; if (int.TryParse(((DropDownList)sender).SelectedValue, out valSelected)) <br />
&nbsp; &nbsp; { <br />
&nbsp; &nbsp; &nbsp; &nbsp; Numbers.Items.Clear(); <br />
&nbsp; &nbsp; &nbsp; &nbsp; int start = 0; <br />
&nbsp; &nbsp; &nbsp; &nbsp; int end = 0; <br />
&nbsp; &nbsp; &nbsp; &nbsp; switch (valSelected) <br />
&nbsp; &nbsp; &nbsp; &nbsp; { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 1: <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; start = 1; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end = 5; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 2: <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; start = 6; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end = 10; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 3: <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; start = 11; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end = 15; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break; <br />
&nbsp; &nbsp; &nbsp; &nbsp; } <br />
&nbsp; &nbsp; &nbsp; &nbsp; for (int i = start; i &lt;= end; i++ ) <br />
&nbsp; &nbsp; &nbsp; &nbsp; { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Numbers.Items.Add(new ListItem(i.ToString(), i.ToString())); <br />
&nbsp; &nbsp; &nbsp; &nbsp; } <br />
&nbsp; &nbsp; &nbsp; &nbsp; Numbers.Visible = true; <br />
&nbsp; &nbsp; } <br />
} <br />
&nbsp;<br />
protected void Numbers_SelectedIndexChanged(object sender, EventArgs e) <br />
{ <br />
&nbsp; &nbsp; Thread.Sleep(2000); <br />
&nbsp; &nbsp; Result.Text = string.Format(&quot;Vous avez choisi : {0}&quot;, ((DropDownList)sender).SelectedValue); <br />
&nbsp; &nbsp; Result.Visible = true; <br />
}</div></div>
<p>Pour rajouter la fonctionnalité de mise à jour sans rechargement total de la page, c&rsquo;est très simple.<br />
Il faut rajouter un scriptManager à la page, et un UpdatePanel qui contiendra la deuxième dropdown et le label (on pourrait le faire contenir toute la page, mais la première liste n&rsquo;étant jamais rechargée, nous n&rsquo;en avons pas besoin).</p>
<p>Et ca donne ceci :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;asp:ScriptManager ID=&quot;ScriptManager1&quot; runat=&quot;server&quot; /&gt; <br />
&nbsp;<br />
&nbsp;<br />
&lt;asp:UpdateProgress ID=&quot;UpdateProgress1&quot; runat=&quot;server&quot; DisplayAfter=&quot;5&quot;&gt; <br />
&nbsp; &nbsp; &lt;ProgressTemplate&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;span style=&quot;color: Red&quot;&gt;Mise à jour.....&lt;/span&gt; <br />
&nbsp; &nbsp; &lt;/ProgressTemplate&gt; <br />
&lt;/asp:UpdateProgress&gt; <br />
&nbsp;<br />
&lt;div&gt; <br />
&nbsp; &nbsp; &lt;asp:DropDownList runat=&quot;server&quot; ID=&quot;GroupNumbers&quot; AutoPostBack=&quot;true&quot; OnSelectedIndexChanged=&quot;DropDownChange&quot;&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:ListItem Text=&quot;Choisir ...&quot; Value=&quot;&quot; /&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:ListItem Text=&quot;1 --&gt; 5&quot; Value=&quot;1&quot; /&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:ListItem Text=&quot;6 --&gt; 10&quot; Value=&quot;2&quot; /&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:ListItem Text=&quot;11 --&gt; 15&quot; Value=&quot;3&quot; /&gt; <br />
&nbsp; &nbsp; &lt;/asp:DropDownList&gt; <br />
&lt;/div&gt; <br />
&nbsp;<br />
&lt;asp:UpdatePanel ID=&quot;UpdatePanel1&quot; runat=&quot;server&quot;&gt; <br />
&nbsp; &nbsp; &lt;ContentTemplate&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:DropDownList runat=&quot;server&quot; ID=&quot;Numbers&quot; AutoPostBack=&quot;true&quot; OnSelectedIndexChanged=&quot;Numbers_SelectedIndexChanged&quot; Visible=&quot;false&quot;&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/asp:DropDownList&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Label runat=&quot;server&quot; ID=&quot;Result&quot; Visible=&quot;false&quot; /&gt; <br />
&nbsp; &nbsp; &lt;/ContentTemplate&gt; <br />
&nbsp; &nbsp; &lt;Triggers&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:AsyncPostBackTrigger ControlID=&quot;GroupNumbers&quot; EventName=&quot;SelectedIndexChanged&quot; /&gt; <br />
&nbsp; &nbsp; &lt;/Triggers&gt; <br />
&lt;/asp:UpdatePanel&gt;</div></div>
<p>Simple non ?</p>
<p>Tout ce qu&rsquo;on a à faire c&rsquo;est de mettre les balises à rechager dans le ContentTemplate de l&rsquo;UpdatePanel et à spécifier quel événement doit être intercepté pour faire le rechargement dynamique. Pour cela, on utilise le trigger AsyncPostBackTrigger en précisant l&rsquo;EventName à SelectedIndexChanged, qui est l&rsquo;événement de changement pour la liste déroulante.</p>
<p>Notez au passage l&rsquo;utilisation du controle UpdateProgress pour afficher un petit message lors du rechargement dynamique.</p>
<p>Si vous voulez vous convaincre qu&rsquo;aucun rechargement de page n&rsquo;a lieu, rajoutez un label hors de l&rsquo;update panel :</p>
<p><code class="codecolorer text default"><span class="text">&lt;asp:Label runat=&quot;server&quot; ID=&quot;lelabel&quot; /&gt;</span></code><br />
que vous initialisez dans le OnLoad avec la date du jour :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">protected override void OnLoad(EventArgs e) <br />
{ <br />
&nbsp; &nbsp; lelabel.Text = DateTime.Now.ToString(); <br />
&nbsp; &nbsp; base.OnLoad(e); <br />
}</div></div>
<p>Vous pourrez constater que la valeur du label ne change pas.</p>
<p><a href="ftp://ftp-developpez.com/nico-pyright/blog/demoUpdatePanelDropDown.rar">Télécharger la démo (13 ko)</a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
